New thread library
This commit is contained in:
parent
7788fd5409
commit
1544f90960
70 changed files with 1041 additions and 4684 deletions
|
|
@ -1,26 +0,0 @@
|
|||
/*
|
||||
* Atomic reference counts - used by applications.
|
||||
*
|
||||
* We use locks to avoid the assembly of the Plan 9 versions.
|
||||
*/
|
||||
|
||||
#include "threadimpl.h"
|
||||
|
||||
void
|
||||
incref(Ref *r)
|
||||
{
|
||||
lock(&r->lk);
|
||||
r->ref++;
|
||||
unlock(&r->lk);
|
||||
}
|
||||
|
||||
long
|
||||
decref(Ref *r)
|
||||
{
|
||||
long n;
|
||||
|
||||
lock(&r->lk);
|
||||
n = --r->ref;
|
||||
unlock(&r->lk);
|
||||
return n;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue