push (SizedQueue)

    /*
     * Document-method: push
     * call-seq: push(obj)
     *
     * Pushes +obj+ to the queue.
     *
     */

    static VALUE
    rb_queue_push(VALUE self, VALUE value)
    {
        Queue *queue;
        Data_Get_Struct(self, Queue, queue);

        lock_mutex(&queue->mutex);
        while (queue->capacity && queue->values.size >= queue->capacity) {
            wait_condvar(&queue->space_available, &queue->mutex);
        }
        push_list(&queue->values, value);
        signal_condvar(&queue->value_available);
        unlock_mutex(&queue->mutex);

        return self;
    }