Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
seminar-breakout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shashank Suhas
seminar-breakout
Commits
f8969459
Commit
f8969459
authored
Jul 18, 2016
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cannot use thread._stop in py3
parent
8d3c709c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
tensorpack/utils/concurrency.py
tensorpack/utils/concurrency.py
+3
-3
No files found.
tensorpack/utils/concurrency.py
View file @
f8969459
...
...
@@ -29,15 +29,15 @@ class StoppableThread(threading.Thread):
"""
def
__init__
(
self
):
super
(
StoppableThread
,
self
)
.
__init__
()
self
.
_stop
=
threading
.
Event
()
self
.
_stop
_evt
=
threading
.
Event
()
def
stop
(
self
):
""" stop the thread"""
self
.
_stop
.
set
()
self
.
_stop
_evt
.
set
()
def
stopped
(
self
):
""" check whether the thread is stopped or not"""
return
self
.
_stop
.
isSet
()
return
self
.
_stop
_evt
.
isSet
()
def
queue_put_stoppable
(
self
,
q
,
obj
):
""" put obj to queue, but will give up if the thread is stopped"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment