]> rtime.felk.cvut.cz Git - orte.git/blobdiff - orte/liborte/ORTEThreadUtils.c
version 0.2.2 (mac, solaris patch)
[orte.git] / orte / liborte / ORTEThreadUtils.c
index 5b708645060ab868b423e4d611de7e8395b33468..5110fbaed63b7ed08b513b3f336af7c24e8fd434 100644 (file)
@@ -23,7 +23,7 @@
 
 /*****************************************************************************/
 void
-ORTEDomainWakeUpReceivingThread(ORTEDomain *d,sock_t *sock,u_int16_t port) {
+ORTEDomainWakeUpReceivingThread(ORTEDomain *d,sock_t *sock,uint16_t port) {
   struct sockaddr_in    des;
   char                  sIPAddress[MAX_STRING_IPADDRESS_LENGTH];
   int                   i;
@@ -50,11 +50,15 @@ ORTEDomainWakeUpReceivingThread(ORTEDomain *d,sock_t *sock,u_int16_t port) {
 /*****************************************************************************/
 void
 ORTEDomainWakeUpSendingThread(ObjectEntry *objectEntry) {
+  debug(25,10) ("WakeUpSendingThread : start\n");
   if (objectEntry->htimNeedWakeUp) {
-    int value;
-    sem_getvalue(&objectEntry->htimSendSem,&value);
-    if (!value)
-      sem_post(&objectEntry->htimSendSem);
+    pthread_mutex_lock(&objectEntry->htimSendMutex);
+    if (objectEntry->htimSendCondValue==0) {
+      debug(25,8) ("WakeUpSendingThread : send wakeup signal\n");
+      pthread_cond_signal(&objectEntry->htimSendCond);
+      objectEntry->htimSendCondValue=1;
+    }
+    pthread_mutex_unlock(&objectEntry->htimSendMutex);
   }
 }