win32/deps/ruby211/ext/thread/thread.c
/*
 * Document-method: SizedQueue#push
 * call-seq:
 *   push(object)
 *   enq(object)
 *   <<(object)
 *
 * Pushes +object+ to the queue.
 *
 * If there is no space left in the queue, waits until space becomes available.
 */


Pushes +object+ to the queue.

If there is no space left in the queue, waits until space becomes available.
Pushes + object + to the queue . If there is no space left in the queue waits until space becomes available .
static VALUE
rb_szqueue_push(VALUE self, VALUE obj)
{
    struct waiting_delete args;
    args.waiting = GET_SZQUEUE_WAITERS(self);
    args.th      = rb_thread_current();
    while (queue_length(self) >= GET_SZQUEUE_ULONGMAX(self)) {
	rb_ary_push(args.waiting, args.th);
	rb_ensure((VALUE (*)())rb_thread_sleep_deadly, (VALUE)0, queue_delete_from_waiting, (VALUE)&args);
    }
    return queue_do_push(self, obj);
}
static VALUE rb_szqueue_push ( VALUE self , VALUE obj ) { struct waiting_delete args ; args . waiting = GET_SZQUEUE_WAITERS ( self ) ; args . th = rb_thread_current ( ) ; while ( queue_length ( self ) >= GET_SZQUEUE_ULONGMAX ( self ) ) { rb_ary_push ( args . waiting , args . th ) ; rb_ensure ( ( VALUE ( * ) ( ) ) rb_thread_sleep_deadly , ( VALUE ) 0 , queue_delete_from_waiting , ( VALUE ) & args ) ; } return queue_do_push ( self , obj ) ; }
Document-method: SizedQueue#push
 call-seq:
   push(object)
   enq(object)
   <<(object)
Document - method : SizedQueue#push call - seq : push ( object ) enq ( object ) << ( object )