2002/07/15 23:17:09
[org.ibex.core.git] / src / org / xwt / ThreadMessage.java
index cd22019..bbd1f24 100644 (file)
@@ -38,7 +38,7 @@ public class ThreadMessage extends Thread implements Message {
     private static Object[] emptyobj = new Object[] { };
 
     /** creates a new thread to execute function <tt>f</tt> */
-    public static void newthread(Function f) {
+    public static synchronized void newthread(Function f) {
         ThreadMessage ret = (ThreadMessage)spare.remove(false);
         if (ret == null) {
             if (threadcount < Platform.maxThreads()) ret = new ThreadMessage();