On Fri, Dec 7, 2012 at 10:18 AM, Carlo E. Prelz <[email protected]> wrote:
>         Subject: how to trigger a thread by event
>         Date: Fri 07 Dec 12 06:05:43PM +0900
>
> Quoting XueBrian ([email protected]):
>
>> Here my question is how can I defer the thread execution until
>> something happened, like an event?
>
> I am not sure I understand what you want to do. Threads can be stopped
> and restarted. If, from within the code of your thread, you call first
> thing
>
> Thread::stop
>
> then, whenever you need the execution to restart, you can call t.run
> from your main process. Look at the example that is returned to you by
> running.

I do not recommend doing that.  Generally one should rather use thread
synchronization primitives to control execution of threads.

Cheers

robert

--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

-- You received this message because you are subscribed to the Google Groups 
ruby-talk-google group. To post to this group, send email to 
[email protected]. To unsubscribe from this group, send email 
to [email protected]. For more options, visit this 
group at https://groups.google.com/d/forum/ruby-talk-google?hl=en

Reply via email to