Files
plan9port/src/libthread/ref.c
rsc 49588d5d90 Tweaks to various bits.
Until I hear otherwise, Refs aren't used enough to
merit their own assembly.  They are now implemented with locks.
2003-12-17 04:34:52 +00:00

21 lines
185 B
C

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