mailing list of musl libc
 help / color / mirror / code / Atom feed
456fb9f48d2e0decb4ea254eeab7bd61a1a1a778 blob 551 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
27
28
 
#include "pthread_impl.h"
#include "syscall.h"

static volatile int check_pi_result = -1;

int pthread_mutexattr_setprotocol(pthread_mutexattr_t *a, int protocol)
{
	int r;
	switch (protocol) {
	case PTHREAD_PRIO_NONE:
		a->__attr &= ~8;
		return 0;
	case PTHREAD_PRIO_INHERIT:
		r = check_pi_result;
		if (r < 0) {
			volatile int lk = 0;
			r = -__futexcall(&lk, FUTEX_LOCK_PI, 0, 0);
			a_store(&check_pi_result, r);
		}
		if (r) return r;
		a->__attr |= 8;
		return 0;
	case PTHREAD_PRIO_PROTECT:
		return ENOTSUP;
	default:
		return EINVAL;
	}
}
debug log:

solving 456fb9f48d2e ...
found 456fb9f48d2e in https://inbox.vuxu.org/musl/20201227184032.22413-17-alobakin@pm.me/
found 8b80c1ce9b14 in https://git.vuxu.org/mirror/musl/
preparing index
index prepared:
100644 8b80c1ce9b14c1b039de327c9870dea08a3ca846	src/thread/pthread_mutexattr_setprotocol.c

applying [1/1] https://inbox.vuxu.org/musl/20201227184032.22413-17-alobakin@pm.me/
diff --git a/src/thread/pthread_mutexattr_setprotocol.c b/src/thread/pthread_mutexattr_setprotocol.c
index 8b80c1ce9b14..456fb9f48d2e 100644

Checking patch src/thread/pthread_mutexattr_setprotocol.c...
Applied patch src/thread/pthread_mutexattr_setprotocol.c cleanly.

index at:
100644 456fb9f48d2e0decb4ea254eeab7bd61a1a1a778	src/thread/pthread_mutexattr_setprotocol.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).