From 1d7827e613663cf3bc504672a0ddbea695198e74 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 12 Aug 2014 11:18:33 +0200 Subject: race condition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/__main__.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/__main__.py') diff --git a/src/__main__.py b/src/__main__.py index b835aee..114c9af 100755 --- a/src/__main__.py +++ b/src/__main__.py @@ -286,14 +286,10 @@ try: if not use_posix: s.P(timeout) s.Z(timeout) - try: - m.P(0) - except ipc.BusyError: - pass - else: - if s.value == 0: - s.set_value(threshold) - m.V() + m.P() + if s.value == 0: + s.set_value(threshold) + m.V() else: x.P(timeout) c.V() -- cgit v1.2.3-70-g09d2