Until I hear otherwise, Refs aren't used enough to merit their own assembly. They are now implemented with locks.
21 lines
185 B
C
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;
|
|
}
|