summaryrefslogtreecommitdiff
path: root/Lib
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2003-04-30 05:32:32 +0000
committerBrett Cannon <bcannon@gmail.com>2003-04-30 05:32:32 +0000
commit43c2698263c4fbae398f01b26c443a6e3c9238f8 (patch)
treeb36be1a5dea67a0fbd679f91d2c536739856539d /Lib
parentbb73b2a259e70fc5f9eac8463ad3502772b47277 (diff)
downloadcpython-43c2698263c4fbae398f01b26c443a6e3c9238f8.tar.gz
Change from a threading.Condition object to a threading.Event object for
signalling when the TCP server is done. Should hopefully solve hanging issues for Solaris 8 & 9. Solves the apparent hanging issue with OS X. Closes patch #729988 .
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_logging.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py
index 93fb4a2706..60995620bb 100644
--- a/Lib/test/test_logging.py
+++ b/Lib/test/test_logging.py
@@ -88,7 +88,8 @@ class LogRecordStreamHandler(StreamRequestHandler):
logger = logging.getLogger(logname)
logger.handle(record)
-socketDataProcessed = threading.Condition()
+# The server sets socketDataProcessed when it's done.
+socketDataProcessed = threading.Event()
class LogRecordSocketReceiver(ThreadingTCPServer):
"""
@@ -115,9 +116,7 @@ class LogRecordSocketReceiver(ThreadingTCPServer):
self.handle_request()
abort = self.abort
#notify the main thread that we're about to exit
- socketDataProcessed.acquire()
- socketDataProcessed.notify()
- socketDataProcessed.release()
+ socketDataProcessed.set()
def process_request(self, request, client_address):
#import threading
@@ -467,9 +466,7 @@ def test_main():
finally:
#wait for TCP receiver to terminate
- socketDataProcessed.acquire()
socketDataProcessed.wait()
- socketDataProcessed.release()
for thread in threads:
thread.join()
banner("logrecv output", "begin")