Linux heracles.o2switch.net 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
/
opt
/
alt
/
ruby21
/
share
/
ri
/
2.1.0
/
system
/
Queue
/
//opt/alt/ruby21/share/ri/2.1.0/system/Queue/cdesc-Queue.ri
U:RDoc::NormalClass[iI" Queue:ET@I"Object;To:RDoc::Markup::Document:@parts[o;;[ o:RDoc::Markup::Paragraph;[I"LThis class provides a way to synchronize communication between threads.;To:RDoc::Markup::BlankLine o; ;[I" Example:;T@o:RDoc::Markup::Verbatim;[I"require 'thread' ;TI"queue = Queue.new ;TI" ;TI"producer = Thread.new do ;TI" 5.times do |i| ;TI"+ sleep rand(i) # simulate expense ;TI" queue << i ;TI" puts "#{i} produced" ;TI" end ;TI" end ;TI" ;TI"consumer = Thread.new do ;TI" 5.times do |i| ;TI" value = queue.pop ;TI"- sleep rand(i/2) # simulate expense ;TI"# puts "consumed #{value}" ;TI" end ;TI"end;T:@format0: @fileI"ext/thread/thread.c;T:0@omit_headings_from_table_of_contents_below0; 0;0[ [ [ [[I" class;T[[:public[[I"new;TI"ext/thread/thread.c;T[:protected[ [:private[ [I" instance;T[[;[[I"<<;T@4[I" clear;T@4[I"deq;T@4[I"empty?;T@4[I"enq;T@4[I"length;T@4[I"marshal_dump;T@4[I"num_waiting;T@4[I"pop;T@4[I" push;T@4[I" shift;T@4[I" size;T@4[;[ [;[ [ [U:RDoc::Context::Section[i 0o;;[ ; 0;0[@(@(cRDoc::TopLevel