summaryrefslogtreecommitdiffstats
path: root/Demo/threads
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-09-14 16:44:15 (GMT)
committerGuido van Rossum <guido@python.org>1998-09-14 16:44:15 (GMT)
commit4117e5428bf1ff3d26d23bd77472265412473ad9 (patch)
treed3a38e1c85eb46e5299cec0d5fb358cdc1db28fe /Demo/threads
parentf9a6d7d49425a04b10e4373077230c6cb93c5817 (diff)
downloadcpython-4117e5428bf1ff3d26d23bd77472265412473ad9.zip
cpython-4117e5428bf1ff3d26d23bd77472265412473ad9.tar.gz
cpython-4117e5428bf1ff3d26d23bd77472265412473ad9.tar.bz2
nannified
Diffstat (limited to 'Demo/threads')
-rw-r--r--Demo/threads/sync.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/Demo/threads/sync.py b/Demo/threads/sync.py
index 3ad0fff..a8556c4 100644
--- a/Demo/threads/sync.py
+++ b/Demo/threads/sync.py
@@ -474,16 +474,16 @@ class mrsw:
self.rwOK.release()
def write_to_read(self):
- self.rwOK.acquire()
- if not self.writing:
- raise ValueError, \
- '.write_to_read() invoked without an active writer'
- self.writing = 0
- self.nw = self.nw - 1
- self.nr = self.nr + 1
- if not self.nw:
- self.readOK.broadcast()
- self.rwOK.release()
+ self.rwOK.acquire()
+ if not self.writing:
+ raise ValueError, \
+ '.write_to_read() invoked without an active writer'
+ self.writing = 0
+ self.nw = self.nw - 1
+ self.nr = self.nr + 1
+ if not self.nw:
+ self.readOK.broadcast()
+ self.rwOK.release()
# The rest of the file is a test case, that runs a number of parallelized
# quicksorts in parallel. If it works, you'll get about 600 lines of