Add yield
authorbdemsky <bdemsky>
Fri, 25 Apr 2008 08:04:30 +0000 (08:04 +0000)
committerbdemsky <bdemsky>
Fri, 25 Apr 2008 08:04:30 +0000 (08:04 +0000)
Robust/src/ClassLibrary/Thread.java
Robust/src/ClassLibrary/ThreadDSM.java
Robust/src/Runtime/thread.c

index 727c986dacd98c96ecf193de34f12048c32a08a3..8e790bb087c4b7bbbb6aa2747d0efcdec5c43b5b 100644 (file)
@@ -9,6 +9,8 @@ public class Thread {
        t.run();
     }
 
+    public static native void yield();
+
     public void join() {
        nativeJoin();
     }
index d5c0a0ce9998f00b946083f66b573696e0783894..7c7563982be6ff0716b2b3f64c71a74b0b62e97d 100644 (file)
@@ -7,6 +7,8 @@ public class Thread {
         threadDone = false;
     }
 
+    public static native void yield();
+
     public final native void join();
 
     public final native void start(int mid);
index 655a883b1416efa4a990312b321733dd36475e38..00b8a6e01c69516b969c86d3d4b86d1691b981e1 100644 (file)
@@ -136,6 +136,12 @@ void CALL11(___Thread______sleep____J, long long ___millis___, long long ___mill
 #endif
 }
 
+#if defined(DSTM)||defined(THREADS)
+void CALL00(___Thread______yield____) {
+  pthread_yield();
+}
+#endif
+
 #ifdef DSTM
 /* Add thread join capability */
 void CALL01(___Thread______join____, struct ___Thread___ * ___this___) {