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:
parent
041e4852d2
commit
3d05e77ca1
21 changed files with 201 additions and 286 deletions
|
@ -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];\
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue