| Server IP : 162.214.74.102 / Your IP : 216.73.217.58 Web Server : Apache System : Linux dedi-4363141.lrsys.com.br 3.10.0-1160.119.1.el7.tuxcare.els25.x86_64 #1 SMP Wed Oct 1 17:37:27 UTC 2025 x86_64 User : lrsys ( 1015) PHP Version : 5.6.40 Disable Function : exec,passthru,shell_exec,system MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /opt/cpanel/ea-ruby24/root/usr/share/ri/system/ConditionVariable/ |
Upload File : |
U:RDoc::NormalClass[iI"ConditionVariable:ET@I"Object;To:RDoc::Markup::Document:@parts[o;;[
o:RDoc::Markup::Paragraph;[I"OConditionVariable objects augment class Mutex. Using condition variables, ;TI"Qit is possible to suspend while in the middle of a critical section until a ;TI" resource becomes available.;To:RDoc::Markup::BlankLine o; ;[I"
Example:;T@o:RDoc::Markup::Verbatim;[I"require 'thread'
;TI"
;TI"mutex = Mutex.new
;TI"&resource = ConditionVariable.new
;TI"
;TI"a = Thread.new {
;TI" mutex.synchronize {
;TI". # Thread 'a' now needs the resource
;TI" resource.wait(mutex)
;TI"* # 'a' can now have the resource
;TI"
}
;TI"}
;TI"
;TI"b = Thread.new {
;TI" mutex.synchronize {
;TI"7 # Thread 'b' has finished using the resource
;TI" resource.signal
;TI"
}
;TI"};T:@format0:
@fileI"thread_sync.c;T:0@omit_headings_from_table_of_contents_below0;
0;0[ [ [ [[I"
class;T[[:public[[I"new;TI"thread_sync.c;T[:protected[ [:private[ [I"
instance;T[[;[[I"broadcast;T@7[I"signal;T@7[I" wait;T@7[;[ [;[ [ [U:RDoc::Context::Section[i 0o;;[ ;
0;0[@+@+cRDoc::TopLevel