diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2010-06-09 14:01:51 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2010-06-09 14:01:51 +0200 |
commit | 4e6bece08aea01859a232e99a1e1ad8cc1eb7d36 (patch) | |
tree | 33a0ebf9c5510b191de219029c8cfedb9df97ab3 /lib/git/async/pool.py | |
parent | a988e6985849e4f6a561b4a5468d525c25ce74fe (diff) | |
download | gitpython-4e6bece08aea01859a232e99a1e1ad8cc1eb7d36.tar.gz |
HSCondition: Fixed terrible bug which it inherited from its default python Condition implementation, related to the notify method not being treadsafe. Although I was aware of it, I missed the first check which tests for the size - the result could be incorrect if the whole method wasn't locked.
Testing runs stable now, allowing to move on \!
Diffstat (limited to 'lib/git/async/pool.py')
-rw-r--r-- | lib/git/async/pool.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/git/async/pool.py b/lib/git/async/pool.py index 7ed6fd8e..66a2a105 100644 --- a/lib/git/async/pool.py +++ b/lib/git/async/pool.py @@ -58,14 +58,17 @@ class RPoolChannel(RChannel): def set_pre_cb(self, fun = lambda count: None): """Install a callback to call with the item count to be read before any - item is actually read from the channel. + item is actually read from the channel. The call must be threadsafe if + the channel is passed to more than one tasks. If it fails, the read will fail with an IOError If a function is not provided, the call is effectively uninstalled.""" self._pre_cb = fun def set_post_cb(self, fun = lambda item: item): """Install a callback to call after the items were read. The function - returns a possibly changed item list. If it raises, the exception will be propagated. + returns a possibly changed item list.The call must be threadsafe if + the channel is passed to more than one tasks. + If it raises, the exception will be propagated. If a function is not provided, the call is effectively uninstalled.""" self._post_cb = fun |