enclose

thgrp.enclose â thgrp
Instance Public methods

Prevents threads from being added to or removed from the receiving ThreadGroup. New threads can still be started in an enclosed ThreadGroup.

1
2
3
4
ThreadGroup::Default.enclose        #=> #<ThreadGroup:0x4029d914>
thr = Thread::new { Thread.stop }   #=> #<Thread:0x402a7210 sleep>
tg = ThreadGroup::new               #=> #<ThreadGroup:0x402752d4>
tg.add thr

produces:

1
ThreadError: can't move from the enclosed thread group
doc_ruby_on_rails
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.