broadcast (ConditionVariable)

    /*
     * Document-method: broadcast
     * call-seq: broadcast
     *
     * Wakes up all threads waiting for this condition.
     *
     */

    static VALUE
    rb_condvar_broadcast(VALUE self)
    {
        ConditionVariable *condvar;

        Data_Get_Struct(self, ConditionVariable, condvar);

        rb_thread_critical = 1;
        rb_ensure(wake_all, (VALUE)&condvar->waiting, set_critical, 0);
        rb_thread_schedule();

        return self;
    }