mailing list of musl libc
 help / color / mirror / code / Atom feed
3dda19abd047c0fd3399378a1cc362171ce73615 blob 586 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
 
#include <threads.h>
#include <pthread.h>
#include <errno.h>

int mtx_timedlock_base(mtx_t *restrict m, int time_base, const struct timespec *restrict ts)
{
	clockid_t clock = CLOCK_REALTIME;
	switch (time_base)
	{
	case TIME_UTC:
		clock = CLOCK_REALTIME;
		break;
	case TIME_MONOTONIC:
		clock = CLOCK_MONOTONIC;
		break;
	default:
		return thrd_error;
	}
	int ret = pthread_mutex_clocklock((pthread_mutex_t *)m, clock, ts);
	switch (ret) {
	default:        return thrd_error;
	case 0:         return thrd_success;
	case ETIMEDOUT: return thrd_timedout;
	}
}
debug log:

solving 3dda19ab ...
found 3dda19ab in https://inbox.vuxu.org/musl/20230620143703.1415-6-luoyonggang@gmail.com/

applying [1/1] https://inbox.vuxu.org/musl/20230620143703.1415-6-luoyonggang@gmail.com/
diff --git a/src/thread/mtx_timedlock_base.c b/src/thread/mtx_timedlock_base.c
new file mode 100644
index 00000000..3dda19ab

1:7: trailing whitespace.
#include <threads.h>\r
1:8: trailing whitespace.
#include <pthread.h>\r
1:9: trailing whitespace.
#include <errno.h>\r
1:10: trailing whitespace.
\r
1:11: trailing whitespace.
int mtx_timedlock_base(mtx_t *restrict m, int time_base, const struct timespec *restrict ts)\r
Checking patch src/thread/mtx_timedlock_base.c...
Applied patch src/thread/mtx_timedlock_base.c cleanly.
warning: squelched 20 whitespace errors
warning: 25 lines add whitespace errors.

index at:
100644 3dda19abd047c0fd3399378a1cc362171ce73615	src/thread/mtx_timedlock_base.c

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).