25#ifndef LOG4CPLUS_THREAD_SYNCPRIMS_H
26#define LOG4CPLUS_THREAD_SYNCPRIMS_H
30#if defined (LOG4CPLUS_HAVE_PRAGMA_ONCE)
35#include <condition_variable>
41template <
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;
136template <
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;
189template <
typename SyncPrim>
196template <
typename SyncPrim>
205template <
typename SyncPrim>
214template <
typename SyncPrim>
223template <
typename SyncPrim>
232template <
typename SyncPrim>
241template <
typename SyncPrim>
259template <
typename SyncPrim>
272template <
typename SyncPrim, void (SyncPrim:: * lock_func) () const,
273 void (SyncPrim:: * unlock_func) () const>
282template <
typename SyncPrim, void (SyncPrim:: * lock_func) () const,
283 void (SyncPrim:: * unlock_func) () const>
288 (sp->*unlock_func) ();
292template <
typename SyncPrim, void (SyncPrim:: * lock_func) () const,
293 void (SyncPrim:: * unlock_func) () const>
302template <
typename SyncPrim, void (SyncPrim:: * lock_func) () const,
303 void (SyncPrim:: * unlock_func) () const>
308 (sp->*unlock_func) ();
312template <
typename SyncPrim, void (SyncPrim:: * lock_func) () const,
313 void (SyncPrim:: * unlock_func) () const>
322template <
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