xref: /plan9-contrib/sys/src/libthread/ref.c (revision 7dd7cddf99dd7472612f1413b4da293630e6b1bc)
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