From: bdemsky Date: Fri, 25 Apr 2008 08:04:30 +0000 (+0000) Subject: Add yield X-Git-Tag: preEdgeChange~139 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=08f643ffa18fc2911bc37f98c770eba730d8f7dd;p=IRC.git Add yield --- diff --git a/Robust/src/ClassLibrary/Thread.java b/Robust/src/ClassLibrary/Thread.java index 727c986d..8e790bb0 100644 --- a/Robust/src/ClassLibrary/Thread.java +++ b/Robust/src/ClassLibrary/Thread.java @@ -9,6 +9,8 @@ public class Thread { t.run(); } + public static native void yield(); + public void join() { nativeJoin(); } diff --git a/Robust/src/ClassLibrary/ThreadDSM.java b/Robust/src/ClassLibrary/ThreadDSM.java index d5c0a0ce..7c756398 100644 --- a/Robust/src/ClassLibrary/ThreadDSM.java +++ b/Robust/src/ClassLibrary/ThreadDSM.java @@ -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); diff --git a/Robust/src/Runtime/thread.c b/Robust/src/Runtime/thread.c index 655a883b..00b8a6e0 100644 --- a/Robust/src/Runtime/thread.c +++ b/Robust/src/Runtime/thread.c @@ -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___) {