Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switch to snakecase for threading related functions to clear deprecation warning in python 3.10 #213

Merged
merged 1 commit into from
Dec 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions beaker/synchronization.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,10 +328,10 @@ def do_release_read_lock(self):
# check if we are the last asynchronous reader thread
# out the door.
if self.asynch == 0:
# yes. so if a sync operation is waiting, notifyAll to wake
# yes. so if a sync operation is waiting, notify_all to wake
# it up
if self.current_sync_operation is not None:
self.condition.notifyAll()
self.condition.notify_all()
elif self.asynch < 0:
raise LockError("Synchronizer error - too many "
"release_read_locks called")
Expand All @@ -357,7 +357,7 @@ def do_acquire_write_lock(self, wait=True):
# establish ourselves as the current sync
# this indicates to other read/write operations
# that they should wait until this is None again
self.current_sync_operation = _threading.currentThread()
self.current_sync_operation = _threading.current_thread()

# now wait again for asyncs to finish
if self.asynch > 0:
Expand All @@ -377,7 +377,7 @@ def do_acquire_write_lock(self, wait=True):
def do_release_write_lock(self):
self.condition.acquire()
try:
if self.current_sync_operation is not _threading.currentThread():
if self.current_sync_operation is not _threading.current_thread():
raise LockError("Synchronizer error - current thread doesnt "
"have the write lock")

Expand All @@ -386,7 +386,7 @@ def do_release_write_lock(self):
self.current_sync_operation = None

# tell everyone to get ready
self.condition.notifyAll()
self.condition.notify_all()
finally:
# everyone go !!
self.condition.release()