synchronize()
public
Obtains a lock, runs the block, and releases the lock when the block completes. See the example
under Mutex.
Show source
static VALUE
rb_mutex_synchronize_m(VALUE self, VALUE args)
{
if (!rb_block_given_p()) {
rb_raise(rb_eThreadError, "must be called with a block");
}
return rb_mutex_synchronize(self, rb_yield, Qundef);
}