|
Click
|
#include <multithread.hh>
Public Types | |
| typedef ptr | write_ptr |
Public Member Functions | |
| shared (T p) | |
| ptr | operator-> () |
| ptr | read () |
| ptr | write () |
| void | get (ptr &o) |
| uint32_t | refcnt () |
| bool | unshared () |
| bool | write_held () |
| bool | hasref () |
| T * | unprotected_ptr () |
Wrap a pointer to V with a reference count. Call get() and put() to get and put reference. When created, it has a reference count of 1 when the call to put() goes to 0, it calls delete on the pointer.