Floris Bruynooghe avatar Floris Bruynooghe committed b7a5b51

Fix some reace conditions in the tests

Comments (0)

Files changed (3)

+# HG changeset patch
+# Parent ef3757074d7e42ec85ba780abe572322e77202ab
+# User Floris Bruynooghe <flub@devork.be>
+# Date 1314663883 -3600
+
+diff --git a/doc/modules.rst b/doc/modules.rst
+--- a/doc/modules.rst
++++ b/doc/modules.rst
+@@ -18,3 +18,4 @@ Module Reference
+    modules/websocket
+    modules/wsgi
+    modules/zmq
++   modules/xthread
+diff --git a/doc/modules/xthread.rst b/doc/modules/xthread.rst
+new file mode 100644
+--- /dev/null
++++ b/doc/modules/xthread.rst
+@@ -0,0 +1,5 @@
++:mod:`xthread` -- Cross-thread/greenthread sycronisation primitives
++===================================================================
++
++.. automodule:: eventlet.xthread
++	:members:
 xthread
 tpool
+docs
 # Placed by Bitbucket
 # HG changeset patch
 # Parent e2a73a7f7e459d258010b40d0ce3b55aca4aa179
 # User Floris Bruynooghe <flub@devork.be>
-# Date 1338144464 -3600
+# Date 1338543064 -3600
 
 Create xthread package
 
 new file mode 100644
 --- /dev/null
 +++ b/tests/xthread_test.py
-@@ -0,0 +1,1229 @@
+@@ -0,0 +1,1232 @@
 +# Copyright (C) 2011-2012 Abilisoft Ltd.
 +# http://abilisoft.com
 +
 +        def waiter():
 +            shr.ret = notif.wait()
 +        def notifier():
++            while len(notif._waiters) < 2:
++                eventlet.sleep(0.005)
 +            notif.notify_all()
 +        w1 = eventlet.spawn(waiter)
 +        w2 = eventlet.spawn(waiter)
-+        n = eventlet.spawn_after(0.01, notifier)
++        n = eventlet.spawn(notifier)
 +        join(n)
 +        join(w1)
 +        join(w2)
 +            notif.wait()
 +            l.append(True)
 +        def notifier():
-+            time.sleep(0.01)
++            while len(notif._waiters) < 2:
++                time.sleep(0.005)
 +            notif.notify_all()
 +        w1 = mkthread(waiter)
 +        w2 = mkthread(waiter)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.