add wait/notify
authorbdemsky <bdemsky>
Sun, 3 Apr 2011 05:38:59 +0000 (05:38 +0000)
committerbdemsky <bdemsky>
Sun, 3 Apr 2011 05:38:59 +0000 (05:38 +0000)
Robust/src/Runtime/object.c
Robust/src/Runtime/object.h

index 14d12050d317e3a41380e56776f6766198c87d86..cdf75048084c6cdf6b71c6e5e209bbc0b903e41f 100644 (file)
@@ -69,20 +69,24 @@ int CALL01(___Object______MonitorEnter____, struct ___Object___ * ___this___) {
   }
 #endif
 }
+#ifdef D___Object______notify____
 void CALL01(___Object______notify____, struct ___Object___ * ___this___) {
   pthread_mutex_lock(&objlock);
   pthread_cond_broadcast(&objcond);
   pthread_mutex_unlock(&objlock);
 }
-
+#endif
+#ifdef D___Object______notifyAll____
 void CALL01(___Object______notifyAll____, struct ___Object___ * ___this___) {
   pthread_mutex_lock(&objlock);
   pthread_cond_broadcast(&objcond);
   pthread_mutex_unlock(&objlock);
 }
-
+#endif
+#ifdef D___Object______wait____
 void CALL01(___Object______wait____, struct ___Object___ * ___this___) {
   //release lock
+  pthread_t self=pthread_self();
   int lockcount=VAR(___this___)->lockcount;
   if (VAR(___this___)->___prevlockobject___==NULL) {
     pthread_setspecific(threadlocks, VAR(___this___)->___nextlockobject___);
@@ -127,6 +131,7 @@ void CALL01(___Object______wait____, struct ___Object___ * ___this___) {
     }
   }
 }
+#endif
 
 int CALL01(___Object______MonitorExit____, struct ___Object___ * ___this___) {
 #ifndef NOLOCK
index 8c177340246dd97f23a7189e9e51394e29786b58..1c430450fe8db74090cfb023d31b8d6d8d6146cb 100644 (file)
@@ -13,5 +13,14 @@ int CALL01(___Object______getType____, struct ___Object___ * ___this___);
 #ifdef THREADS
 int CALL01(___Object______MonitorEnter____, struct ___Object___ * ___this___);
 int CALL01(___Object______MonitorExit____, struct ___Object___ * ___this___);
+#ifdef D___Object______notify____
+void CALL01(___Object______notify____, struct ___Object___ * ___this___);
+#endif
+#ifdef D___Object______notifyAll____
+void CALL01(___Object______notifyAll____, struct ___Object___ * ___this___);
+#endif
+#ifdef D___Object______wait____
+void CALL01(___Object______wait____, struct ___Object___ * ___this___);
+#endif
 #endif
 #endif