max (SizedQueue)

    /*
     * Document-method: max
     * call-seq: max
     *
     * Returns the maximum size of the queue.
     *
     */

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

        lock_mutex(&queue->mutex);
        result = ULONG2NUM(queue->capacity);
        unlock_mutex(&queue->mutex);

        return result;
    }