Yes, I need a Thread.join()!!! I tried your solution, but it doesn't works. In my application I have a Timer. When it fires I start a Thread and in the same Timer.fired() event I wait for the end of the Thread. Maybe is it impossible to do?
Thanks a lot, Antonio On Sep 17, 2008, at 5:04 AM, Antonio wrote: > Hi All, > I'm working on TOSThreads but I have a problem. > My question is very simple: > > Is it possible to wait for the end of a Thread in TinyOS? > I mean, when I do "call Thread.start(NULL);" I know I'm calling the > Thread.run() method. The caller execution goes on. If the caller > wants to > know if the Thread.run() is ended, what can be done? > It sounds like we need a Thread.join()... One way to do this is with a condition variable. I.e., the new thread sets a variable to 1 just before it exits and signals a condition; the waiting thread is waiting on the condition variable, checking if the variable is 1. Phil -- Email.it, the professional e-mail, gratis per te: http://www.email.it/f Sponsor: Tom Raider Anniversary ora sul tuo cellulare! Entra in azione! Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=8277&d=17-9 _______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
