mirror of
https://github.com/ruby/ruby.git
synced 2026-01-27 04:24:23 +00:00
thread_sync.c: rename mutex_trylock internal function
[Bug #21793] To fix a naming conflict on solaris.
This commit is contained in:
parent
8cf4f373ff
commit
fb1dd92d30
Notes:
git
2025-12-18 20:08:26 +00:00
@ -235,7 +235,7 @@ mutex_locked(rb_mutex_t *mutex, rb_thread_t *th, rb_serial_t ec_serial)
|
||||
}
|
||||
|
||||
static inline bool
|
||||
mutex_trylock(rb_mutex_t *mutex, rb_thread_t *th, rb_serial_t ec_serial)
|
||||
do_mutex_trylock(rb_mutex_t *mutex, rb_thread_t *th, rb_serial_t ec_serial)
|
||||
{
|
||||
if (mutex->ec_serial == 0) {
|
||||
RUBY_DEBUG_LOG("%p ok", mutex);
|
||||
@ -252,7 +252,7 @@ mutex_trylock(rb_mutex_t *mutex, rb_thread_t *th, rb_serial_t ec_serial)
|
||||
static VALUE
|
||||
rb_mut_trylock(rb_execution_context_t *ec, VALUE self)
|
||||
{
|
||||
return RBOOL(mutex_trylock(mutex_ptr(self), ec->thread_ptr, rb_ec_serial(ec)));
|
||||
return RBOOL(do_mutex_trylock(mutex_ptr(self), ec->thread_ptr, rb_ec_serial(ec)));
|
||||
}
|
||||
|
||||
VALUE
|
||||
@ -315,7 +315,7 @@ do_mutex_lock(struct mutex_args *args, int interruptible_p)
|
||||
rb_raise(rb_eThreadError, "can't be called from trap context");
|
||||
}
|
||||
|
||||
if (!mutex_trylock(mutex, th, ec_serial)) {
|
||||
if (!do_mutex_trylock(mutex, th, ec_serial)) {
|
||||
if (mutex->ec_serial == ec_serial) {
|
||||
rb_raise(rb_eThreadError, "deadlock; recursive locking");
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user