c++ Programming Glossary: lockingptr
May volatile be in user defined types to help writing thread-safe code http://stackoverflow.com/questions/2491495/may-volatile-be-in-user-defined-types-to-help-writing-thread-safe-code Stealing from the article template typename T class LockingPtr public Constructors destructors LockingPtr volatile T obj Mutex.. T class LockingPtr public Constructors destructors LockingPtr volatile T obj Mutex mtx pObj_ const_cast T obj pMtx_ mtx mtx.Lock.. T obj Mutex mtx pObj_ const_cast T obj pMtx_ mtx mtx.Lock ~LockingPtr pMtx_ Unlock Pointer behavior T operator return pObj_ T operator..
|