diff options
author | cinap_lenrek <cinap_lenrek@gmx.de> | 2013-09-21 19:53:27 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@gmx.de> | 2013-09-21 19:53:27 +0200 |
commit | 3d05e77ca1f743e5b4091c6bfe311460175ed9ae (patch) | |
tree | d17a262c559e389e3adb6171de308800eb9d3426 /sys/include/libc.h | |
parent | 041e4852d258f05fe5f60964a76c99714905774e (diff) |
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.
Diffstat (limited to 'sys/include/libc.h')
-rw-r--r-- | sys/include/libc.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/include/libc.h b/sys/include/libc.h index a92e5680d..c84acc0f5 100644 --- a/sys/include/libc.h +++ b/sys/include/libc.h @@ -410,11 +410,18 @@ enum { 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];\ |