New thread library

This commit is contained in:
rsc 2004-12-25 21:56:33 +00:00
parent 7788fd5409
commit 1544f90960
70 changed files with 1041 additions and 4684 deletions

View file

@ -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;
}