From: Mark Volkmann Date: 2006-01-10T23:04:30+09:00 Subject: Re: opposite of Thread.wakeup On 1/10/06, Robert Klemme wrote: > Mark Volkmann wrote: > > If I create a thread and don't want it to be eligible to run until I > > decide to make it eligible later, how do I make it sleep? In other > > words, what's the opposite of Thread.wakeup? > > > > Thread::stop stops the execution of the current thread. I need a way > > to stop execution of a thread that is not the current thread so that > > it won't be scheduled. > > You use a ConditionVariable. See the Queue example at > http://www.rubygarden.org/ruby?MultiThreading > You need to invoke cond.wait and cond.signal. HTH That will definitely work, but I was hoping for something simpler like a Thread.stop instance method. I suppose that isn't supported because it is considered unsafe for the same reason it is deprecated in Java. -- R. Mark Volkmann Partner, Object Computing, Inc.