1 #include <u.h> 2 #include <libc.h> 3 #include <threadimpl.h> 4 5 void 6 incref(Ref *r) 7 { 8 // returns the old value; 9 _xinc(&r->ref); 10 } 11 12 long 13 decref(Ref *r) 14 { 15 // returns the new value; 16 return _xdec(&r->ref); 17 } 18