winpthreads: mutex.c: remove static function `__pthread_mutex_timedlock`
In 87281623c635c264cb128d4fd9af54c7a4705ae6, function `pthread_mutex_timedlock`
was renamed to `__pthread_mutex_timedlock` and modified to always use
`struct _timespec64`; it was used as a common implementation for
`pthread_mutex_timedlock{32|64}` functions.
Move code from `__pthread_mutex_timedlock` to `pthread_mutex_timedlock64` and
call `pthread_mutex_timedlock64` from `pthread_mutex_timedlock32`.
Signed-off-by: Kirill Makurin <maiddaisuki@outlook.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
diff --git a/mingw-w64-libraries/winpthreads/src/mutex.c b/mingw-w64-libraries/winpthreads/src/mutex.c
index b1ab7e1..54bd8fd 100644
--- a/mingw-w64-libraries/winpthreads/src/mutex.c
+++ b/mingw-w64-libraries/winpthreads/src/mutex.c
@@ -186,8 +186,7 @@
return pthread_mutex_lock_intern (m, INFINITE);
}
-/* Internal version which always uses `struct _timespec64`. */
-static int __pthread_mutex_timedlock(pthread_mutex_t *m, const struct _timespec64 *ts)
+int pthread_mutex_timedlock64(pthread_mutex_t *m, const struct _timespec64 *ts)
{
unsigned long long patience;
if (ts != NULL) {
@@ -202,15 +201,10 @@
return pthread_mutex_lock_intern(m, patience);
}
-int pthread_mutex_timedlock64(pthread_mutex_t *m, const struct _timespec64 *ts)
-{
- return __pthread_mutex_timedlock (m, ts);
-}
-
int pthread_mutex_timedlock32(pthread_mutex_t *m, const struct _timespec32 *ts)
{
struct _timespec64 ts64 = {.tv_sec = ts->tv_sec, .tv_nsec = ts->tv_nsec};
- return __pthread_mutex_timedlock (m, &ts64);
+ return pthread_mutex_timedlock64 (m, &ts64);
}
int pthread_mutex_unlock(pthread_mutex_t *m)