Changeset 2759 in Sophya for trunk/SophyaLib/SysTools/zthread.h
- Timestamp:
- May 24, 2005, 6:29:28 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/SysTools/zthread.h
r2753 r2759 77 77 inline void wait() 78 78 { pthread_cond_wait(_condv, _mutx); } 79 //! Signal a condition change on the mutex object 79 //! Signal a condition change on the mutex object. 80 80 inline void signal() 81 81 { pthread_cond_signal(_condv); } … … 95 95 Constructor. Locks the associated ZMutex. 96 96 97 - <tt> sigbr==0 </tt> No calls to signal() or broadcast() 98 in destructor 97 99 - <tt> sigbr==1 </tt> destructor calls \c signal on 98 100 the associated ZMutex … … 101 103 */ 102 104 explicit inline ZSync(ZMutex & mtx, int sigbr=0) 103 {_mtx = &mtx; _sigbr = sigbr; mtx.lock(); } 105 {_mtx = &mtx; _sigbr = sigbr; _mtx->lock(); } 106 107 /*! 108 Constructor from ZMutex pointer. 109 Locks the associated ZMutex object if non null pointer 110 */ 111 explicit inline ZSync(ZMutex * mtxp, int sigbr=0) 112 {_mtx = mtxp; _sigbr = sigbr; if (_mtx) _mtx->lock(); } 104 113 inline ~ZSync() 105 114 { … … 110 119 } 111 120 } 121 //! Calls the wait method on the associated ZMutex object 122 inline void wait() { if (_mtx) _mtx->wait(); } 112 123 //! To avoid warnings about unused variables 113 124 inline int NOp() { return _sigbr; }
Note:
See TracChangeset
for help on using the changeset viewer.