diff options
-rw-r--r-- | lib/libc_r/uthread/uthread_mutex.c | 3 | ||||
-rw-r--r-- | lib/libkse/thread/thr_mutex.c | 3 | ||||
-rw-r--r-- | lib/libpthread/thread/thr_mutex.c | 3 |
3 files changed, 9 insertions, 0 deletions
diff --git a/lib/libc_r/uthread/uthread_mutex.c b/lib/libc_r/uthread/uthread_mutex.c index f7662c7..ec6c0f6 100644 --- a/lib/libc_r/uthread/uthread_mutex.c +++ b/lib/libc_r/uthread/uthread_mutex.c @@ -402,6 +402,9 @@ pthread_mutex_lock(pthread_mutex_t * mutex) { int ret = 0; + if (_thread_initial == NULL) + _thread_init(); + if (mutex == NULL) ret = EINVAL; diff --git a/lib/libkse/thread/thr_mutex.c b/lib/libkse/thread/thr_mutex.c index f7662c7..ec6c0f6 100644 --- a/lib/libkse/thread/thr_mutex.c +++ b/lib/libkse/thread/thr_mutex.c @@ -402,6 +402,9 @@ pthread_mutex_lock(pthread_mutex_t * mutex) { int ret = 0; + if (_thread_initial == NULL) + _thread_init(); + if (mutex == NULL) ret = EINVAL; diff --git a/lib/libpthread/thread/thr_mutex.c b/lib/libpthread/thread/thr_mutex.c index f7662c7..ec6c0f6 100644 --- a/lib/libpthread/thread/thr_mutex.c +++ b/lib/libpthread/thread/thr_mutex.c @@ -402,6 +402,9 @@ pthread_mutex_lock(pthread_mutex_t * mutex) { int ret = 0; + if (_thread_initial == NULL) + _thread_init(); + if (mutex == NULL) ret = EINVAL; |