Tweaks to various bits.
Until I hear otherwise, Refs aren't used enough to merit their own assembly. They are now implemented with locks.
This commit is contained in:
@@ -3,11 +3,18 @@
|
||||
void
|
||||
incref(Ref *r)
|
||||
{
|
||||
_xinc(&r->ref);
|
||||
lock(&r->lk);
|
||||
r->ref++;
|
||||
unlock(&r->lk);
|
||||
}
|
||||
|
||||
long
|
||||
decref(Ref *r)
|
||||
{
|
||||
return _xdec(&r->ref);
|
||||
long n;
|
||||
|
||||
lock(&r->lk);
|
||||
n = --r->ref;
|
||||
unlock(&r->lk);
|
||||
return n;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user