From: KOSAKI Motohiro Date: 2012-07-21T15:41:38+09:00 Subject: [ruby-core:46584] Re: [ruby-trunk - Feature #6762][Open] Control interrupt timing > * Thread.control_interrupt > * Thread.check_interrupt Eek. Please don't use 'interrupt' word. It makes a lot of confusing to Unix programmer. > > Rdoc documents are: > > call-seq: > Thread.control_interrupt(hash) { ... } -> result of the block > > Thread.control_interrupt controls interrupt timing. > > _interrupt_ means asynchronous event and corresponding procedure > by Thread#raise, Thread#kill, signal trap (not supported yet) > and main thread termination (if main thread terminates, then all > other thread will be killed). No. control_interrupt should NOT inhibit running trap procedure. Because of, Thread.control_interrupt() is per-thread, but trap is not per-thread. btw, Probably it should be per-fiber instead of per-thread. > _hash_ has pairs of ExceptionClass and TimingSymbol. TimingSymbol > is one of them: > - :immediate Invoke interrupt immediately. > - :on_blocking Invoke interrupt while _BlockingOperation_. I don't think 'on_blocking' is good name. Example, pthread cancel have a 'cancellation point' concept and many blocking functions is defined as cancellation point. but a few non blocking functions also defined as cancellation point. So, this on_blocking should have a name as concept likes interruptible point. (but again, i don't like interrupt word) > - :never Never invoke interrupt.