Skip to content

Commit

Permalink
Fix conflict with other thread attributes.
Browse files Browse the repository at this point in the history
  • Loading branch information
ionelmc committed Mar 20, 2014
1 parent 5d587f0 commit 9876bc2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions celery/tests/utils/test_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,21 +72,21 @@ class Burglar(Thread):

def __init__(self, cache):
self.cache = cache
self._is_shutdown = Event()
self._is_stopped = Event()
self.__is_shutdown = Event()
self.__is_stopped = Event()
Thread.__init__(self)

def run(self):
while not self._is_shutdown.isSet():
while not self.__is_shutdown.isSet():
try:
self.cache.data.popitem(last=False)
except KeyError:
break
self._is_stopped.set()
self.__is_stopped.set()

def stop(self):
self._is_shutdown.set()
self._is_stopped.wait()
self.__is_shutdown.set()
self.__is_stopped.wait()
self.join(THREAD_TIMEOUT_MAX)

burglar = Burglar(x)
Expand Down

0 comments on commit 9876bc2

Please sign in to comment.