empty? (Queue)

    /*
     * Document-method: empty?
     * call-seq: empty?
     *
     * Returns +true+ if the queue is empty.
     *
     */

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

        lock_mutex(&queue->mutex);
        result = queue->values.size == 0 ? Qtrue : Qfalse;
        unlock_mutex(&queue->mutex);

        return result;
    }