mailing list of musl libc
 help / color / mirror / code / Atom feed
beb435da7c14af2e25b65d1d0eea74a3d95f6aa7 blob 243 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
 
#include <semaphore.h>
#include <limits.h>
#include "pthread_impl.h"

int sem_trywait(sem_t *sem)
{
	int val;
	while ((val=sem->__val[0]) & SEM_VALUE_MAX) {
		if (a_cas(sem->__val, val, val-1)==val) return 0;
	}
	errno = EAGAIN;
	return -1;
}
debug log:

solving beb435da ...
found beb435da in https://git.vuxu.org/mirror/musl/

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).