Method: ConcurrentSHM::Mutex#lock
- Defined in:
- ext/concurrent-shm/posix.c
#lock ⇒ nil
Locks the mutex, blocking until the mutex becomes available, if necessary.
616 617 618 619 620 621 622 623 624 625 626 627 |
# File 'ext/concurrent-shm/posix.c', line 616 static VALUE mutex_lock(VALUE self) { if (mutex_try_lock(self) == Qtrue) { return Qnil; } mutex_t * mu = value_as_mutex(self); int err = (int)(uintptr_t)rb_thread_call_without_gvl((void * (*)(void *))pthread_mutex_lock, &mu->shared->mu, NULL, NULL); rb_check_syserr_fail_strf(err, err, "pthread_mutex_lock()"); return Qnil; } |