diff options
author | Julien Danjou <julien@danjou.info> | 2014-10-02 17:04:53 +0200 |
---|---|---|
committer | Julien Danjou <julien@danjou.info> | 2014-10-02 18:02:13 +0200 |
commit | bc664f6082979768793d87ca747965aff3cbad03 (patch) | |
tree | 2915f51a1aa78b71207270f475df45a1ba7fa342 | |
parent | d9458168ab377a2bf316f0ae0d45681534bdd38f (diff) | |
download | tooz-bc664f6082979768793d87ca747965aff3cbad03.tar.gz |
Fix IPC driver on OS X
OS X does not support timeout on semaphore, so the tests block for ever.
Add a test to check that if we support or not that feature.
Change-Id: I1a6bec0d40a5166d5ea9643b5fca128b46b2ec02
-rw-r--r-- | tooz/drivers/ipc.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tooz/drivers/ipc.py b/tooz/drivers/ipc.py index c754958..905680c 100644 --- a/tooz/drivers/ipc.py +++ b/tooz/drivers/ipc.py @@ -69,6 +69,10 @@ class IPCLock(locking.Lock): def acquire(self, blocking=True): timeout = self.timeout if blocking else 0 + if ((blocking is False or timeout is not None) + and sysv_ipc.SEMAPHORE_TIMEOUT_SUPPORTED is False): + raise tooz.NotImplemented( + "This system does not support semaphore timeout") try: self._lock.acquire(timeout=timeout) except (sysv_ipc.BusyError, sysv_ipc.ExistentialError): |