ruby-changes:66053
From: Peter <ko1@a...>
Date: Wed, 5 May 2021 09:38:17 +0900 (JST)
Subject: [ruby-changes:66053] 46dd295a53 (master): Fix compilation error in thread_win32.c
https://git.ruby-lang.org/ruby.git/commit/?id=46dd295a53 From 46dd295a53640a5ccf21688a5539ac50e17008f6 Mon Sep 17 00:00:00 2001 From: Peter Zhu <peter@p...> Date: Tue, 4 May 2021 23:57:24 +0000 Subject: Fix compilation error in thread_win32.c USE_WIN32_MUTEX flag may not be defined. --- thread_win32.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/thread_win32.c b/thread_win32.c index 04c4865..8b5120b 100644 --- a/thread_win32.c +++ b/thread_win32.c @@ -322,7 +322,7 @@ native_sleep(rb_thread_t *th, rb_hrtime_t *rel) https://github.com/ruby/ruby/blob/trunk/thread_win32.c#L322 void rb_native_mutex_lock(rb_nativethread_lock_t *lock) { -#if USE_WIN32_MUTEX +#ifdef USE_WIN32_MUTEX w32_mutex_lock(lock->mutex, false); #else EnterCriticalSection(&lock->crit); @@ -332,7 +332,7 @@ rb_native_mutex_lock(rb_nativethread_lock_t *lock) https://github.com/ruby/ruby/blob/trunk/thread_win32.c#L332 int rb_native_mutex_trylock(rb_nativethread_lock_t *lock) { -#if USE_WIN32_MUTEX +#ifdef USE_WIN32_MUTEX return w32_mutex_lock(lock->mutex, true); #else return TryEnterCriticalSection(&lock->crit) == 0 ? EBUSY : 0; @@ -342,7 +342,7 @@ rb_native_mutex_trylock(rb_nativethread_lock_t *lock) https://github.com/ruby/ruby/blob/trunk/thread_win32.c#L342 void rb_native_mutex_unlock(rb_nativethread_lock_t *lock) { -#if USE_WIN32_MUTEX +#ifdef USE_WIN32_MUTEX thread_debug("release mutex: %p\n", lock->mutex); ReleaseMutex(lock->mutex); #else @@ -353,7 +353,7 @@ rb_native_mutex_unlock(rb_nativethread_lock_t *lock) https://github.com/ruby/ruby/blob/trunk/thread_win32.c#L353 void rb_native_mutex_initialize(rb_nativethread_lock_t *lock) { -#if USE_WIN32_MUTEX +#ifdef USE_WIN32_MUTEX lock->mutex = w32_mutex_create(); /* thread_debug("initialize mutex: %p\n", lock->mutex); */ #else @@ -364,7 +364,7 @@ rb_native_mutex_initialize(rb_nativethread_lock_t *lock) https://github.com/ruby/ruby/blob/trunk/thread_win32.c#L364 void rb_native_mutex_destroy(rb_nativethread_lock_t *lock) { -#if USE_WIN32_MUTEX +#ifdef USE_WIN32_MUTEX w32_close_handle(lock->mutex); #else DeleteCriticalSection(&lock->crit); -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/