From 1816af437456a916a02097c076f4b97565f3307d Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 14 Jun 2014 09:27:25 +0200 Subject: m barrier MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/cmdipc | 14 +++++++++----- 1 file 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: -- cgit v1.2.3-70-g09d2