send doesn't work

unDEFER via Digitalmars-d digitalmars-d at puremagic.com
Tue Nov 15 08:36:00 PST 2016


Hello!
In my thread I'm sending the Tid of the thread to the parent to 
inform it about finishing:
send(tid, thisTid);

The parent thread has the next code to receive it and handle:
receiveTimeout( dur!"hnsecs"(1),
                 (Tid tid)
                 {//the message from child thread handler} );

It is good works for my first child thread.
But, some times ago I have added the second child thread (no, no, 
the first thread and the second thread works not simultaneously) 
and have found that the receiving message doesn't work! The 
parent doesn't get the message although the child sends it.
So in my code have appeared the next insertion in the start of 
thread:
/* Strange, but without sending message
        at start thread makes not working
        sending at end thread */
     send(tid, "Hello");

Now I have added the third child thread. At the first it have 
worked good, but now it again doesn't receive the message. And 
"send hello"-hack doesn't help.
What to do? Why the sending of the message may doesn't work?


More information about the Digitalmars-d mailing list