libc: change tas/sleep locks to cas/semacquire/semrelease locks (from sources)

spinlocks have been changed to use the new semacquire/semrelease
syscalls in combination with atomic compare and swap operations.
This commit is contained in:
cinap_lenrek 2013-09-21 19:53:27 +02:00
parent 041e4852d2
commit 3d05e77ca1
21 changed files with 201 additions and 286 deletions

View file

@ -409,12 +409,19 @@ enum {
}; /* what */
extern void prof(void (*fn)(void*), void *arg, int entries, int what);
/*
* atomic
*/
extern long ainc(long*);
extern long adec(long*);
/*
* synchronization
*/
typedef
struct Lock {
int val;
long key;
long sem;
} Lock;
extern int _tas(int*);
@ -701,9 +708,6 @@ extern char* sysname(void);
extern void werrstr(char*, ...);
#pragma varargck argpos werrstr 1
extern long ainc(long*);
extern long adec(long*);
extern char *argv0;
#define ARGBEGIN for((argv0||(argv0=*argv)),argv++,argc--;\
argv[0] && argv[0][0]=='-' && argv[0][1];\