aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-06-14 09:27:25 +0200
committerMattias Andrée <maandree@operamail.com>2014-06-14 09:27:25 +0200
commit1816af437456a916a02097c076f4b97565f3307d (patch)
tree71bcb4b419b76871db327c5fe29ff5f994a64626
parentm (diff)
downloadcmdipc-1816af437456a916a02097c076f4b97565f3307d.tar.gz
cmdipc-1816af437456a916a02097c076f4b97565f3307d.tar.bz2
cmdipc-1816af437456a916a02097c076f4b97565f3307d.tar.xz
m barrier
Signed-off-by: Mattias Andrée <maandree@operamail.com>
-rwxr-xr-xsrc/cmdipc14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/cmdipc b/src/cmdipc
index db5a86b..9677a8a 100755
--- a/src/cmdipc
+++ b/src/cmdipc
@@ -253,12 +253,16 @@ try:
print('key: %i.%i' % (s.key, m.key))
nocmd = False
if (len(parser.files) == 2) and (parser.files[1] == 'enter'):
- s.P()
+ s.P(timeout)
s.Z()
- m.P()
- if s.value == 0:
- s.value = threshold
- m.V()
+ try:
+ m.P(0)
+ except sysv_ipc.BusyError: pass
+ except posix_ipc.BusyError: pass
+ else:
+ if s.value == 0:
+ s.value = threshold
+ m.V()
elif key[0] is not None:
nocmd = True
if parser.opts['--remove'] is not None: