*
*/
-#include "orte.h"
+#include "orte_all.h"
/*****************************************************************************/
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;
}
} else {
des.sin_addr.s_addr = inet_addr("127.0.0.1"); //local IPAddress
- sock_sendto(sock,NULL,0,&des,sizeof(des));
+ sock_sendto(sock,&i,1,&des,sizeof(des));
debug(25,2) ("Sent wake up signal to: %s.%d\n",
IPAddressToString(ntohl(des.sin_addr.s_addr),sIPAddress),
port);
/*****************************************************************************/
void
ORTEDomainWakeUpSendingThread(ObjectEntry *objectEntry) {
- if (objectEntry->htimNeedWakeUp)
+ debug(25,10) ("WakeUpSendingThread : start\n");
+ if (objectEntry->htimNeedWakeUp) {
+ 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);
+ }
}