From 183e11dc0dd1ced3244a3065131ce46e0a0c70c7 Mon Sep 17 00:00:00 2001 From: modeco80 Date: Sat, 20 Jul 2024 06:47:28 -0400 Subject: [PATCH] don't stub threadsafe statics we are using winpthreads now anyways, so we can unstub the existing code. --- speech2/src/winxp_compat_threadsafe_static.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/speech2/src/winxp_compat_threadsafe_static.c b/speech2/src/winxp_compat_threadsafe_static.c index 3fe546e..4f452ed 100644 --- a/speech2/src/winxp_compat_threadsafe_static.c +++ b/speech2/src/winxp_compat_threadsafe_static.c @@ -10,7 +10,7 @@ #include #include -//#include +#include static const int UNINITIALIZED = 0; static const int INITIALIZING = -1; @@ -23,27 +23,27 @@ static const int EPOCH_BASE = INT_MIN; int _Init_global_epoch = EPOCH_BASE; __declspec(thread) int _Init_thread_epoch = EPOCH_BASE; -//static pthread_mutex_t _Init_thread_mutex = PTHREAD_MUTEX_INITIALIZER; -//static pthread_cond_t _Init_thread_cond = PTHREAD_COND_INITIALIZER; +static pthread_mutex_t _Init_thread_mutex = PTHREAD_MUTEX_INITIALIZER; +static pthread_cond_t _Init_thread_cond = PTHREAD_COND_INITIALIZER; void __cdecl _Init_thread_lock() { - // pthread_mutex_lock(&_Init_thread_mutex); + pthread_mutex_lock(&_Init_thread_mutex); } void __cdecl _Init_thread_unlock() { - //pthread_mutex_unlock(&_Init_thread_mutex); + pthread_mutex_unlock(&_Init_thread_mutex); } void __cdecl _Init_thread_wait_v2() { - //pthread_cond_wait(&_Init_thread_cond, &_Init_thread_mutex); + pthread_cond_wait(&_Init_thread_cond, &_Init_thread_mutex); } void __cdecl _Init_thread_notify() { - // pthread_cond_broadcast(&_Init_thread_cond); + pthread_cond_broadcast(&_Init_thread_cond); } void __cdecl _Init_thread_header(int* const pOnce)