Initial Patch of Auction House bot rev. 135
[auctionmangos.git] / dep / ACE_wrappers / ace / RW_Thread_Mutex.h
blob4902829669641bbaad957e4f4a26511c654823a3
1 // -*- C++ -*-
3 //==========================================================================
4 /**
5 * @file RW_Thread_Mutex.h
7 * $Id: RW_Thread_Mutex.h 80826 2008-03-04 14:51:23Z wotte $
9 * Moved from Synch.h.
11 * @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
13 //==========================================================================
15 #ifndef ACE_RW_THREAD_MUTEX_H
16 #define ACE_RW_THREAD_MUTEX_H
17 #include /**/ "ace/pre.h"
19 #include /**/ "ace/ACE_export.h"
21 #if !defined (ACE_LACKS_PRAGMA_ONCE)
22 # pragma once
23 #endif /* ACE_LACKS_PRAGMA_ONCE */
25 #if !defined (ACE_HAS_THREADS)
26 # include "ace/Null_Mutex.h"
27 #else /* ACE_HAS_THREADS */
28 // ACE platform supports some form of threading.
30 #include "ace/RW_Mutex.h"
32 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
34 /**
35 * @class ACE_RW_Thread_Mutex
37 * @brief Wrapper for readers/writer locks that exist within a process.
39 class ACE_Export ACE_RW_Thread_Mutex : public ACE_RW_Mutex
41 public:
42 ACE_RW_Thread_Mutex (const ACE_TCHAR *name = 0,
43 void *arg = 0);
45 /// Default dtor.
46 ~ACE_RW_Thread_Mutex (void);
48 /**
49 * Conditionally upgrade a read lock to a write lock. This only
50 * works if there are no other readers present, in which case the
51 * method returns 0. Otherwise, the method returns -1 and sets
52 * @c errno to @c EBUSY. Note that the caller of this method *must*
53 * already possess this lock as a read lock (but this condition is
54 * not checked by the current implementation).
56 int tryacquire_write_upgrade (void);
58 /// Dump the state of an object.
59 void dump (void) const;
61 /// Declare the dynamic allocation hooks.
62 ACE_ALLOC_HOOK_DECLARE;
65 ACE_END_VERSIONED_NAMESPACE_DECL
67 #if defined (__ACE_INLINE__)
68 #include "ace/RW_Thread_Mutex.inl"
69 #endif /* __ACE_INLINE__ */
71 #endif /* !ACE_HAS_THREADS */
73 #include /**/ "ace/post.h"
74 #endif /* ACE_RW_THREAD_MUTEX_H */