U:RDoc::AnyMethod[iI"pending_interrupt?:ETI"Thread::pending_interrupt?;TT: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I" :immediate) { ;TI" Thread.pass ;TI" } ;TI" end ;T: @format0o; ; [I"KIf +error+ is given, then check only for +error+ type deferred events.;T@S:RDoc::Markup::Heading: leveli: textI" Usage;T@o; ; [I"th = Thread.new{ ;TI"> Thread.handle_interrupt(RuntimeError => :on_blocking){ ;TI" while true ;TI" ... ;TI"2 # reach safe point to invoke interrupt ;TI"( if Thread.pending_interrupt? ;TI"= Thread.handle_interrupt(Object => :immediate){} ;TI" end ;TI" ... ;TI" end ;TI" } ;TI"} ;TI" ... ;TI"th.raise # stop thread ;T; 0o; ; [I"PThis example can also be written as the following, which you should use to ;TI"#avoid asynchronous interrupts.;T@o; ; [I"flag = true ;TI"th = Thread.new{ ;TI"> Thread.handle_interrupt(RuntimeError => :on_blocking){ ;TI" while true ;TI" ... ;TI"2 # reach safe point to invoke interrupt ;TI"" break if flag == false ;TI" ... ;TI" end ;TI" } ;TI"} ;TI" ... ;TI"flag = false # stop thread;T; 0: @fileI" thread.c;T:0@omit_headings_from_table_of_contents_below0I":Thread.pending_interrupt?(error = nil) -> true/false ;T0[I" (*args);T@IFI" Thread;TcRDoc::NormalClass00