mailing list of musl libc
 help / color / mirror / code / Atom feed
b0b37cac0077dbbb11d53409dc547efcbdd0a284 blob 666 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
26
 
#include <threads.h>
#include <pthread.h>
#include <errno.h>

int cnd_timedwait_base(cnd_t *restrict c, 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_cond_clockwait((pthread_cond_t *)c, (pthread_mutex_t *)m, clock, ts);
	switch (ret) {
	/* May also return EINVAL or EPERM. */
	default:        return thrd_error;
	case 0:         return thrd_success;
	case ETIMEDOUT: return thrd_timedout;
	}
}
debug log:

solving b0b37cac ...
found b0b37cac 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/cnd_timedwait_base.c b/src/thread/cnd_timedwait_base.c
new file mode 100644
index 00000000..b0b37cac

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 cnd_timedwait_base(cnd_t *restrict c, mtx_t *restrict m, int time_base, const struct timespec *restrict ts)\r
Checking patch src/thread/cnd_timedwait_base.c...
Applied patch src/thread/cnd_timedwait_base.c cleanly.
warning: squelched 21 whitespace errors
warning: 26 lines add whitespace errors.

index at:
100644 b0b37cac0077dbbb11d53409dc547efcbdd0a284	src/thread/cnd_timedwait_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).