Skip to content

Commit c0dcfff

Browse files
committed
Add support for pthread_mutex_clocklock(3)
1 parent e7d6bef commit c0dcfff

File tree

13 files changed

+413
-7
lines changed

13 files changed

+413
-7
lines changed

kos/include/i386-kos/crt-features/crt-kos32.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1323,6 +1323,7 @@
13231323
#define __CRT_HAVE___pthread_cond_timedwait64
13241324
#define __CRT_HAVE___pthread_getspecific
13251325
#define __CRT_HAVE___pthread_key_create
1326+
#define __CRT_HAVE___pthread_mutex_clocklock64
13261327
#define __CRT_HAVE___pthread_mutex_destroy
13271328
#define __CRT_HAVE___pthread_mutex_init
13281329
#define __CRT_HAVE___pthread_mutex_lock
@@ -4717,6 +4718,8 @@
47174718
#define __CRT_HAVE_pthread_main_np
47184719
#define __CRT_HAVE_pthread_mainthread_np
47194720
#define __CRT_HAVE_pthread_multi_np
4721+
#define __CRT_HAVE_pthread_mutex_clocklock
4722+
#define __CRT_HAVE_pthread_mutex_clocklock64
47204723
#define __CRT_HAVE_pthread_mutex_consistent
47214724
#define __CRT_HAVE_pthread_mutex_consistent_np
47224725
#define __CRT_HAVE_pthread_mutex_destroy

kos/include/i386-kos/crt-features/crt-kos64.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,6 +1264,7 @@
12641264
#define __CRT_HAVE___pthread_cond_init
12651265
#define __CRT_HAVE___pthread_getspecific
12661266
#define __CRT_HAVE___pthread_key_create
1267+
#define __CRT_HAVE___pthread_mutex_clocklock64
12671268
#define __CRT_HAVE___pthread_mutex_destroy
12681269
#define __CRT_HAVE___pthread_mutex_init
12691270
#define __CRT_HAVE___pthread_mutex_lock
@@ -4398,6 +4399,7 @@
43984399
#define __CRT_HAVE_pthread_main_np
43994400
#define __CRT_HAVE_pthread_mainthread_np
44004401
#define __CRT_HAVE_pthread_multi_np
4402+
#define __CRT_HAVE_pthread_mutex_clocklock
44014403
#define __CRT_HAVE_pthread_mutex_consistent
44024404
#define __CRT_HAVE_pthread_mutex_consistent_np
44034405
#define __CRT_HAVE_pthread_mutex_destroy
@@ -7659,6 +7661,7 @@
76597661
#define __CRT_HAVE_KOS$__pthread_cond_destroy
76607662
#define __CRT_HAVE_KOS$__pthread_cond_init
76617663
#define __CRT_HAVE_KOS$__pthread_getspecific
7664+
#define __CRT_HAVE_KOS$__pthread_mutex_clocklock64
76627665
#define __CRT_HAVE_KOS$__pthread_mutex_destroy
76637666
#define __CRT_HAVE_KOS$__pthread_mutex_init
76647667
#define __CRT_HAVE_KOS$__pthread_mutex_lock
@@ -10290,6 +10293,7 @@
1029010293
#define __CRT_HAVE_KOS$pthread_join
1029110294
#define __CRT_HAVE_KOS$pthread_key_delete
1029210295
#define __CRT_HAVE_KOS$pthread_kill
10296+
#define __CRT_HAVE_KOS$pthread_mutex_clocklock
1029310297
#define __CRT_HAVE_KOS$pthread_mutex_consistent
1029410298
#define __CRT_HAVE_KOS$pthread_mutex_consistent_np
1029510299
#define __CRT_HAVE_KOS$pthread_mutex_destroy
@@ -12241,6 +12245,7 @@
1224112245
#define __CRT_HAVE_DOS$__pthread_cond_destroy
1224212246
#define __CRT_HAVE_DOS$__pthread_cond_init
1224312247
#define __CRT_HAVE_DOS$__pthread_getspecific
12248+
#define __CRT_HAVE_DOS$__pthread_mutex_clocklock64
1224412249
#define __CRT_HAVE_DOS$__pthread_mutex_destroy
1224512250
#define __CRT_HAVE_DOS$__pthread_mutex_init
1224612251
#define __CRT_HAVE_DOS$__pthread_mutex_lock
@@ -15168,6 +15173,7 @@
1516815173
#define __CRT_HAVE_DOS$pthread_join
1516915174
#define __CRT_HAVE_DOS$pthread_key_delete
1517015175
#define __CRT_HAVE_DOS$pthread_kill
15176+
#define __CRT_HAVE_DOS$pthread_mutex_clocklock
1517115177
#define __CRT_HAVE_DOS$pthread_mutex_consistent
1517215178
#define __CRT_HAVE_DOS$pthread_mutex_consistent_np
1517315179
#define __CRT_HAVE_DOS$pthread_mutex_destroy
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
/* HASH CRC-32:0xeb5b76bd */
2+
/* Copyright (c) 2019-2025 Griefer@Work *
3+
* *
4+
* This software is provided 'as-is', without any express or implied *
5+
* warranty. In no event will the authors be held liable for any damages *
6+
* arising from the use of this software. *
7+
* *
8+
* Permission is granted to anyone to use this software for any purpose, *
9+
* including commercial applications, and to alter it and redistribute it *
10+
* freely, subject to the following restrictions: *
11+
* *
12+
* 1. The origin of this software must not be misrepresented; you must not *
13+
* claim that you wrote the original software. If you use this software *
14+
* in a product, an acknowledgement (see the following) in the product *
15+
* documentation is required: *
16+
* Portions Copyright (c) 2019-2025 Griefer@Work *
17+
* 2. Altered source versions must be plainly marked as such, and must not be *
18+
* misrepresented as being the original software. *
19+
* 3. This notice may not be removed or altered from any source distribution. *
20+
*/
21+
#ifndef __local_pthread_mutex_clocklock_defined
22+
#define __local_pthread_mutex_clocklock_defined
23+
#include <__crt.h>
24+
#include <bits/types.h>
25+
#if defined(__CRT_HAVE_pthread_mutex_clocklock64) || defined(__CRT_HAVE___pthread_mutex_clocklock64) || defined(__CRT_HAVE_pthread_mutex_clocklock)
26+
#include <bits/crt/pthreadtypes.h>
27+
#include <bits/os/timespec.h>
28+
__NAMESPACE_LOCAL_BEGIN
29+
#if !defined(__local___localdep_crt_pthread_mutex_clocklock32_defined) && defined(__CRT_HAVE_pthread_mutex_clocklock)
30+
#define __local___localdep_crt_pthread_mutex_clocklock32_defined
31+
__CREDIRECT(__ATTR_WUNUSED __ATTR_IN(3) __ATTR_INOUT(1),__errno_t,__NOTHROW_RPC,__localdep_crt_pthread_mutex_clocklock32,(__pthread_mutex_t *__restrict __self, __clockid_t __clock_id, struct timespec const *__restrict __abstime),pthread_mutex_clocklock,(__self,__clock_id,__abstime))
32+
#endif /* !__local___localdep_crt_pthread_mutex_clocklock32_defined && __CRT_HAVE_pthread_mutex_clocklock */
33+
#ifndef __local___localdep_pthread_mutex_clocklock64_defined
34+
#define __local___localdep_pthread_mutex_clocklock64_defined
35+
#if defined(__CRT_HAVE_pthread_mutex_clocklock) && __SIZEOF_TIME32_T__ == __SIZEOF_TIME64_T__
36+
__CREDIRECT(__ATTR_WUNUSED __ATTR_IN(3) __ATTR_INOUT(1),__errno_t,__NOTHROW_RPC,__localdep_pthread_mutex_clocklock64,(__pthread_mutex_t *__restrict __self, __clockid_t __clock_id, struct __timespec64 const *__restrict __abstime),pthread_mutex_clocklock,(__self,__clock_id,__abstime))
37+
#elif defined(__CRT_HAVE_pthread_mutex_clocklock64)
38+
__CREDIRECT(__ATTR_WUNUSED __ATTR_IN(3) __ATTR_INOUT(1),__errno_t,__NOTHROW_RPC,__localdep_pthread_mutex_clocklock64,(__pthread_mutex_t *__restrict __self, __clockid_t __clock_id, struct __timespec64 const *__restrict __abstime),pthread_mutex_clocklock64,(__self,__clock_id,__abstime))
39+
#elif defined(__CRT_HAVE___pthread_mutex_clocklock64)
40+
__CREDIRECT(__ATTR_WUNUSED __ATTR_IN(3) __ATTR_INOUT(1),__errno_t,__NOTHROW_RPC,__localdep_pthread_mutex_clocklock64,(__pthread_mutex_t *__restrict __self, __clockid_t __clock_id, struct __timespec64 const *__restrict __abstime),__pthread_mutex_clocklock64,(__self,__clock_id,__abstime))
41+
#elif defined(__CRT_HAVE_pthread_mutex_clocklock)
42+
__NAMESPACE_LOCAL_END
43+
#include <libc/local/pthread/pthread_mutex_clocklock64.h>
44+
__NAMESPACE_LOCAL_BEGIN
45+
#define __localdep_pthread_mutex_clocklock64 __LIBC_LOCAL_NAME(pthread_mutex_clocklock64)
46+
#else /* ... */
47+
#undef __local___localdep_pthread_mutex_clocklock64_defined
48+
#endif /* !... */
49+
#endif /* !__local___localdep_pthread_mutex_clocklock64_defined */
50+
__LOCAL_LIBC(pthread_mutex_clocklock) __ATTR_WUNUSED __ATTR_IN(3) __ATTR_INOUT(1) __errno_t
51+
__NOTHROW_RPC(__LIBCCALL __LIBC_LOCAL_NAME(pthread_mutex_clocklock))(__pthread_mutex_t *__restrict __self, __clockid_t __clock_id, struct timespec const *__restrict __abstime) {
52+
#ifdef __CRT_HAVE_pthread_mutex_clocklock
53+
__errno_t __result;
54+
struct __timespec32 __abstime32;
55+
__abstime32.tv_sec = (__time32_t)__abstime->tv_sec;
56+
__abstime32.tv_nsec = __abstime->tv_nsec;
57+
__result = (__NAMESPACE_LOCAL_SYM __localdep_crt_pthread_mutex_clocklock32)(__self, __clock_id, &__abstime32);
58+
return __result;
59+
#else /* __CRT_HAVE_pthread_mutex_clocklock */
60+
__errno_t __result;
61+
struct __timespec64 __abstime64;
62+
__abstime64.tv_sec = (__time64_t)__abstime->tv_sec;
63+
__abstime64.tv_nsec = __abstime->tv_nsec;
64+
__result = (__NAMESPACE_LOCAL_SYM __localdep_pthread_mutex_clocklock64)(__self, __clock_id, &__abstime64);
65+
return __result;
66+
#endif /* !__CRT_HAVE_pthread_mutex_clocklock */
67+
}
68+
__NAMESPACE_LOCAL_END
69+
#ifndef __local___localdep_pthread_mutex_clocklock_defined
70+
#define __local___localdep_pthread_mutex_clocklock_defined
71+
#define __localdep_pthread_mutex_clocklock __LIBC_LOCAL_NAME(pthread_mutex_clocklock)
72+
#endif /* !__local___localdep_pthread_mutex_clocklock_defined */
73+
#else /* __CRT_HAVE_pthread_mutex_clocklock64 || __CRT_HAVE___pthread_mutex_clocklock64 || __CRT_HAVE_pthread_mutex_clocklock */
74+
#undef __local_pthread_mutex_clocklock_defined
75+
#endif /* !__CRT_HAVE_pthread_mutex_clocklock64 && !__CRT_HAVE___pthread_mutex_clocklock64 && !__CRT_HAVE_pthread_mutex_clocklock */
76+
#endif /* !__local_pthread_mutex_clocklock_defined */
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/* HASH CRC-32:0xd80ddb8f */
2+
/* Copyright (c) 2019-2025 Griefer@Work *
3+
* *
4+
* This software is provided 'as-is', without any express or implied *
5+
* warranty. In no event will the authors be held liable for any damages *
6+
* arising from the use of this software. *
7+
* *
8+
* Permission is granted to anyone to use this software for any purpose, *
9+
* including commercial applications, and to alter it and redistribute it *
10+
* freely, subject to the following restrictions: *
11+
* *
12+
* 1. The origin of this software must not be misrepresented; you must not *
13+
* claim that you wrote the original software. If you use this software *
14+
* in a product, an acknowledgement (see the following) in the product *
15+
* documentation is required: *
16+
* Portions Copyright (c) 2019-2025 Griefer@Work *
17+
* 2. Altered source versions must be plainly marked as such, and must not be *
18+
* misrepresented as being the original software. *
19+
* 3. This notice may not be removed or altered from any source distribution. *
20+
*/
21+
#ifndef __local_pthread_mutex_clocklock64_defined
22+
#define __local_pthread_mutex_clocklock64_defined
23+
#include <__crt.h>
24+
#ifdef __CRT_HAVE_pthread_mutex_clocklock
25+
#include <bits/types.h>
26+
#include <bits/crt/pthreadtypes.h>
27+
#include <bits/os/timespec.h>
28+
__NAMESPACE_LOCAL_BEGIN
29+
#ifndef __local___localdep_crt_pthread_mutex_clocklock32_defined
30+
#define __local___localdep_crt_pthread_mutex_clocklock32_defined
31+
__CREDIRECT(__ATTR_WUNUSED __ATTR_IN(3) __ATTR_INOUT(1),__errno_t,__NOTHROW_RPC,__localdep_crt_pthread_mutex_clocklock32,(__pthread_mutex_t *__restrict __self, __clockid_t __clock_id, struct timespec const *__restrict __abstime),pthread_mutex_clocklock,(__self,__clock_id,__abstime))
32+
#endif /* !__local___localdep_crt_pthread_mutex_clocklock32_defined */
33+
__LOCAL_LIBC(pthread_mutex_clocklock64) __ATTR_WUNUSED __ATTR_IN(3) __ATTR_INOUT(1) __errno_t
34+
__NOTHROW_RPC(__LIBCCALL __LIBC_LOCAL_NAME(pthread_mutex_clocklock64))(__pthread_mutex_t *__restrict __self, __clockid_t __clock_id, struct __timespec64 const *__restrict __abstime) {
35+
__errno_t __result;
36+
struct __timespec32 __abstime32;
37+
__abstime32.tv_sec = (__time32_t)__abstime->tv_sec;
38+
__abstime32.tv_nsec = __abstime->tv_nsec;
39+
__result = (__NAMESPACE_LOCAL_SYM __localdep_crt_pthread_mutex_clocklock32)(__self, __clock_id, &__abstime32);
40+
return __result;
41+
}
42+
__NAMESPACE_LOCAL_END
43+
#ifndef __local___localdep_pthread_mutex_clocklock64_defined
44+
#define __local___localdep_pthread_mutex_clocklock64_defined
45+
#define __localdep_pthread_mutex_clocklock64 __LIBC_LOCAL_NAME(pthread_mutex_clocklock64)
46+
#endif /* !__local___localdep_pthread_mutex_clocklock64_defined */
47+
#else /* __CRT_HAVE_pthread_mutex_clocklock */
48+
#undef __local_pthread_mutex_clocklock64_defined
49+
#endif /* !__CRT_HAVE_pthread_mutex_clocklock */
50+
#endif /* !__local_pthread_mutex_clocklock64_defined */

kos/include/pthread.h

Lines changed: 81 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* HASH CRC-32:0xe83b08bb */
1+
/* HASH CRC-32:0xe4d54e37 */
22
/* Copyright (c) 2019-2025 Griefer@Work *
33
* *
44
* This software is provided 'as-is', without any express or implied *
@@ -1803,6 +1803,86 @@ __NAMESPACE_LOCAL_USING_OR_IMPL(pthread_mutex_reltimedlock64_np, __FORCELOCAL __
18031803
#endif /* ... */
18041804
#endif /* __USE_TIME64 */
18051805
#endif /* __USE_SOLARIS */
1806+
#ifdef __USE_GNU
1807+
#if defined(__CRT_HAVE_pthread_mutex_clocklock) && (!defined(__USE_TIME_BITS64) || __SIZEOF_TIME32_T__ == __SIZEOF_TIME64_T__)
1808+
/* >> pthread_mutex_clocklock(3), pthread_mutex_clocklock64(3)
1809+
* Same as `pthread_mutex_timedwait(3)', but the given `abstime' is relative to `clock_id',
1810+
* whereas when using `pthread_mutex_timedwait(3)', it is always relative to `CLOCK_REALTIME'.
1811+
* @return: EOK: Success
1812+
* @return: EINVAL: The given `abstime' is invalid
1813+
* @return: EINVAL: Invalid/unsupported `clock_id'
1814+
* @return: ETIMEDOUT: The given `abstime' has expired */
1815+
__CDECLARE(__ATTR_WUNUSED __ATTR_IN(3) __ATTR_INOUT(1),__errno_t,__NOTHROW_RPC,pthread_mutex_clocklock,(pthread_mutex_t *__restrict __self, __clockid_t __clock_id, struct timespec const *__restrict __abstime),(__self,__clock_id,__abstime))
1816+
#elif defined(__CRT_HAVE_pthread_mutex_clocklock64) && (defined(__USE_TIME_BITS64) || __SIZEOF_TIME32_T__ == __SIZEOF_TIME64_T__)
1817+
/* >> pthread_mutex_clocklock(3), pthread_mutex_clocklock64(3)
1818+
* Same as `pthread_mutex_timedwait(3)', but the given `abstime' is relative to `clock_id',
1819+
* whereas when using `pthread_mutex_timedwait(3)', it is always relative to `CLOCK_REALTIME'.
1820+
* @return: EOK: Success
1821+
* @return: EINVAL: The given `abstime' is invalid
1822+
* @return: EINVAL: Invalid/unsupported `clock_id'
1823+
* @return: ETIMEDOUT: The given `abstime' has expired */
1824+
__CREDIRECT(__ATTR_WUNUSED __ATTR_IN(3) __ATTR_INOUT(1),__errno_t,__NOTHROW_RPC,pthread_mutex_clocklock,(pthread_mutex_t *__restrict __self, __clockid_t __clock_id, struct timespec const *__restrict __abstime),pthread_mutex_clocklock64,(__self,__clock_id,__abstime))
1825+
#elif defined(__CRT_HAVE___pthread_mutex_clocklock64) && (defined(__USE_TIME_BITS64) || __SIZEOF_TIME32_T__ == __SIZEOF_TIME64_T__)
1826+
/* >> pthread_mutex_clocklock(3), pthread_mutex_clocklock64(3)
1827+
* Same as `pthread_mutex_timedwait(3)', but the given `abstime' is relative to `clock_id',
1828+
* whereas when using `pthread_mutex_timedwait(3)', it is always relative to `CLOCK_REALTIME'.
1829+
* @return: EOK: Success
1830+
* @return: EINVAL: The given `abstime' is invalid
1831+
* @return: EINVAL: Invalid/unsupported `clock_id'
1832+
* @return: ETIMEDOUT: The given `abstime' has expired */
1833+
__CREDIRECT(__ATTR_WUNUSED __ATTR_IN(3) __ATTR_INOUT(1),__errno_t,__NOTHROW_RPC,pthread_mutex_clocklock,(pthread_mutex_t *__restrict __self, __clockid_t __clock_id, struct timespec const *__restrict __abstime),__pthread_mutex_clocklock64,(__self,__clock_id,__abstime))
1834+
#elif defined(__CRT_HAVE_pthread_mutex_clocklock64) || defined(__CRT_HAVE___pthread_mutex_clocklock64) || defined(__CRT_HAVE_pthread_mutex_clocklock)
1835+
#include <libc/local/pthread/pthread_mutex_clocklock.h>
1836+
/* >> pthread_mutex_clocklock(3), pthread_mutex_clocklock64(3)
1837+
* Same as `pthread_mutex_timedwait(3)', but the given `abstime' is relative to `clock_id',
1838+
* whereas when using `pthread_mutex_timedwait(3)', it is always relative to `CLOCK_REALTIME'.
1839+
* @return: EOK: Success
1840+
* @return: EINVAL: The given `abstime' is invalid
1841+
* @return: EINVAL: Invalid/unsupported `clock_id'
1842+
* @return: ETIMEDOUT: The given `abstime' has expired */
1843+
__NAMESPACE_LOCAL_USING_OR_IMPL(pthread_mutex_clocklock, __FORCELOCAL __ATTR_ARTIFICIAL __ATTR_WUNUSED __ATTR_IN(3) __ATTR_INOUT(1) __errno_t __NOTHROW_RPC(__LIBCCALL pthread_mutex_clocklock)(pthread_mutex_t *__restrict __self, __clockid_t __clock_id, struct timespec const *__restrict __abstime) { return (__NAMESPACE_LOCAL_SYM __LIBC_LOCAL_NAME(pthread_mutex_clocklock))(__self, __clock_id, __abstime); })
1844+
#endif /* ... */
1845+
#ifdef __USE_TIME64
1846+
#if defined(__CRT_HAVE_pthread_mutex_clocklock) && __SIZEOF_TIME32_T__ == __SIZEOF_TIME64_T__
1847+
/* >> pthread_mutex_clocklock(3), pthread_mutex_clocklock64(3)
1848+
* Same as `pthread_mutex_timedwait(3)', but the given `abstime' is relative to `clock_id',
1849+
* whereas when using `pthread_mutex_timedwait(3)', it is always relative to `CLOCK_REALTIME'.
1850+
* @return: EOK: Success
1851+
* @return: EINVAL: The given `abstime' is invalid
1852+
* @return: EINVAL: Invalid/unsupported `clock_id'
1853+
* @return: ETIMEDOUT: The given `abstime' has expired */
1854+
__CREDIRECT(__ATTR_WUNUSED __ATTR_IN(3) __ATTR_INOUT(1),__errno_t,__NOTHROW_RPC,pthread_mutex_clocklock64,(pthread_mutex_t *__restrict __self, __clockid_t __clock_id, struct timespec64 const *__restrict __abstime),pthread_mutex_clocklock,(__self,__clock_id,__abstime))
1855+
#elif defined(__CRT_HAVE_pthread_mutex_clocklock64)
1856+
/* >> pthread_mutex_clocklock(3), pthread_mutex_clocklock64(3)
1857+
* Same as `pthread_mutex_timedwait(3)', but the given `abstime' is relative to `clock_id',
1858+
* whereas when using `pthread_mutex_timedwait(3)', it is always relative to `CLOCK_REALTIME'.
1859+
* @return: EOK: Success
1860+
* @return: EINVAL: The given `abstime' is invalid
1861+
* @return: EINVAL: Invalid/unsupported `clock_id'
1862+
* @return: ETIMEDOUT: The given `abstime' has expired */
1863+
__CDECLARE(__ATTR_WUNUSED __ATTR_IN(3) __ATTR_INOUT(1),__errno_t,__NOTHROW_RPC,pthread_mutex_clocklock64,(pthread_mutex_t *__restrict __self, __clockid_t __clock_id, struct timespec64 const *__restrict __abstime),(__self,__clock_id,__abstime))
1864+
#elif defined(__CRT_HAVE___pthread_mutex_clocklock64)
1865+
/* >> pthread_mutex_clocklock(3), pthread_mutex_clocklock64(3)
1866+
* Same as `pthread_mutex_timedwait(3)', but the given `abstime' is relative to `clock_id',
1867+
* whereas when using `pthread_mutex_timedwait(3)', it is always relative to `CLOCK_REALTIME'.
1868+
* @return: EOK: Success
1869+
* @return: EINVAL: The given `abstime' is invalid
1870+
* @return: EINVAL: Invalid/unsupported `clock_id'
1871+
* @return: ETIMEDOUT: The given `abstime' has expired */
1872+
__CREDIRECT(__ATTR_WUNUSED __ATTR_IN(3) __ATTR_INOUT(1),__errno_t,__NOTHROW_RPC,pthread_mutex_clocklock64,(pthread_mutex_t *__restrict __self, __clockid_t __clock_id, struct timespec64 const *__restrict __abstime),__pthread_mutex_clocklock64,(__self,__clock_id,__abstime))
1873+
#elif defined(__CRT_HAVE_pthread_mutex_clocklock)
1874+
#include <libc/local/pthread/pthread_mutex_clocklock64.h>
1875+
/* >> pthread_mutex_clocklock(3), pthread_mutex_clocklock64(3)
1876+
* Same as `pthread_mutex_timedwait(3)', but the given `abstime' is relative to `clock_id',
1877+
* whereas when using `pthread_mutex_timedwait(3)', it is always relative to `CLOCK_REALTIME'.
1878+
* @return: EOK: Success
1879+
* @return: EINVAL: The given `abstime' is invalid
1880+
* @return: EINVAL: Invalid/unsupported `clock_id'
1881+
* @return: ETIMEDOUT: The given `abstime' has expired */
1882+
__NAMESPACE_LOCAL_USING_OR_IMPL(pthread_mutex_clocklock64, __FORCELOCAL __ATTR_ARTIFICIAL __ATTR_WUNUSED __ATTR_IN(3) __ATTR_INOUT(1) __errno_t __NOTHROW_RPC(__LIBCCALL pthread_mutex_clocklock64)(pthread_mutex_t *__restrict __self, __clockid_t __clock_id, struct timespec64 const *__restrict __abstime) { return (__NAMESPACE_LOCAL_SYM __LIBC_LOCAL_NAME(pthread_mutex_clocklock64))(__self, __clock_id, __abstime); })
1883+
#endif /* ... */
1884+
#endif /* __USE_TIME64 */
1885+
#endif /* __USE_GNU */
18061886
#ifdef __CRT_HAVE_pthread_mutex_unlock
18071887
/* >> pthread_mutex_unlock(3)
18081888
* Unlock the given mutex `self'

0 commit comments

Comments
 (0)