Skip to content

Commit

Permalink
fix comment
Browse files Browse the repository at this point in the history
  • Loading branch information
mpenkov committed Nov 21, 2022
1 parent a1ef236 commit 5d3bb03
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions sqlitedict.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,16 +399,16 @@ def __init__(self, filename, autocommit, journal_mode, outer_stack=True):

#
# Parts of this object's state get accessed from different threads, so
# we use synchronization to avoid race conditions. For example, the
# .exception and ._sqlite_thread_initialized are set inside the new
# daemon thread that we spawned, but they get read from the main
# thread. This is particularly important during initialization: the
# Thread needs some time to actually start working, and until this
# happens, any calls to e.g. check_raise_error() will prematurely
# return None, meaning all is well. If the that connection happens to
# fail, we'll never know about it, and instead wait for a result that
# never arrives (effectively, deadlocking). Locking solves this
# problem by eliminating the race condition.
# we use synchronization to avoid race conditions. For example,
# .exception gets set inside the new daemon thread that we spawned, but
# gets read from the main thread. This is particularly important
# during initialization: the Thread needs some time to actually start
# working, and until this happens, any calls to e.g.
# check_raise_error() will prematurely return None, meaning all is
# well. If the that connection happens to fail, we'll never know about
# it, and instead wait for a result that never arrives (effectively,
# deadlocking). Locking solves this problem by eliminating the race
# condition.
#
self._lock = threading.Lock()
self._lock.acquire()
Expand Down

0 comments on commit 5d3bb03

Please sign in to comment.