clear (SizedQueue)

    /*
     * Document-method: clear
     * call-seq: clear
     *
     * Removes all objects from the queue.
     *
     */

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

        lock_mutex(&queue->mutex);
        clear_list(&queue->values);
        signal_condvar(&queue->space_available);
        unlock_mutex(&queue->mutex);

        return self;
    }