Ejemplo n.º 1
0
static VALUE
wake_all(List *list)
{
    while (list->entries) {
        wake_one(list);
    }
    return Qnil;
}
Ejemplo n.º 2
0
static VALUE
unlock_mutex_inner(Mutex *mutex)
{
    VALUE waking;

    if (!RTEST(mutex->owner)) {
	return Qundef;
    }

    mutex->owner = Qnil;
    waking = wake_one(&mutex->waiting);

    return waking;
}
Ejemplo n.º 3
0
static VALUE
unlock_mutex_inner(Mutex *mutex)
{
    VALUE waking;

    if (mutex->owner != rb_thread_current()) {
	rb_raise(rb_eThreadError, "not owner");
    }

    waking = wake_one(&mutex->waiting);
    mutex->owner = waking;

    return waking;
}