25 #ifndef LOG4CPLUS_THREAD_SYNCPRIMS_H
26 #define LOG4CPLUS_THREAD_SYNCPRIMS_H
30 #if defined (LOG4CPLUS_HAVE_PRAGMA_ONCE)
35 #include <condition_variable>
41 template <
typename SyncPrim>
54 void attach (SyncPrim
const &);
94 #if ! defined (LOG4CPLUS_SINGLE_THREADED)
95 mutable std::mutex mtx;
96 mutable std::condition_variable cv;
97 mutable unsigned maximum;
120 #if ! defined (LOG4CPLUS_SINGLE_THREADED)
121 mutable std::mutex mtx;
122 mutable std::condition_variable cv;
123 mutable bool signaled;
124 mutable unsigned sigcount;
136 template <
typename SyncPrim, void (SyncPrim:: * lock_func) ()
const,
137 void (SyncPrim:: * unlock_func) ()
const>
146 void attach (SyncPrim
const &);
163 void rdlock ()
const;
164 void rdunlock ()
const;
166 void wrlock ()
const;
167 void wrunlock ()
const;
189 template <
typename SyncPrim>
196 template <
typename SyncPrim>
205 template <
typename SyncPrim>
214 template <
typename SyncPrim>
223 template <
typename SyncPrim>
232 template <
typename SyncPrim>
241 template <
typename SyncPrim>
259 template <
typename SyncPrim>
272 template <
typename SyncPrim, void (SyncPrim:: * lock_func) ()
const,
273 void (SyncPrim:: * unlock_func) ()
const>
282 template <
typename SyncPrim, void (SyncPrim:: * lock_func) ()
const,
283 void (SyncPrim:: * unlock_func) ()
const>
288 (sp->*unlock_func) ();
292 template <
typename SyncPrim, void (SyncPrim:: * lock_func) ()
const,
293 void (SyncPrim:: * unlock_func) ()
const>
302 template <
typename SyncPrim, void (SyncPrim:: * lock_func) ()
const,
303 void (SyncPrim:: * unlock_func) ()
const>
308 (sp->*unlock_func) ();
312 template <
typename SyncPrim, void (SyncPrim:: * lock_func) ()
const,
313 void (SyncPrim:: * unlock_func) ()
const>
322 template <
typename SyncPrim, void (SyncPrim:: * lock_func) ()
const,
323 void (SyncPrim:: * unlock_func) ()
const>
ManualResetEvent(ManualResetEvent const &)=delete
ManualResetEvent(bool=false)
bool timed_wait(unsigned long msec) const
Mutex(Mutex const &)=delete
Semaphore(unsigned max, unsigned initial)
Semaphore(Semaphore const &)=delete
SyncGuard & operator=(SyncGuard const &)=delete
void attach_and_lock(SyncPrim const &)
SyncGuard(SyncGuard const &)=delete
void attach(SyncPrim const &)
#define LOG4CPLUS_THREADED(x)
SyncGuardFunc< SharedMutex, &SharedMutex::rdlock, &SharedMutex::rdunlock > SharedMutexReaderGuard
SyncGuard< Mutex > MutexGuard
SyncGuardFunc< SharedMutex, &SharedMutex::wrlock, &SharedMutex::wrunlock > SharedMutexWriterGuard
SyncGuard< Semaphore > SemaphoreGuard