Changes to attempt to silence bcc64x
[ACE_TAO.git] / ACE / ace / Synch_Traits.h
blob9232bf4c9695ea104638125e2431bceef38eeb48
1 // -*- C++ -*-
3 //==========================================================================
4 /**
5 * @file Synch_Traits.h
7 * @author Douglas C. Schmidt <d.schmidt@vanderbilt.edu>
8 */
9 //==========================================================================
11 #ifndef ACE_SYNCH_TRAITS_H
12 #define ACE_SYNCH_TRAITS_H
13 #include /**/ "ace/pre.h"
15 #include /**/ "ace/config-all.h" /* Need to know threads, template settings */
16 #include "ace/Lock.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 # pragma once
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
24 // Forward decl
25 class ACE_Null_Mutex;
26 class ACE_Null_Semaphore;
27 class ACE_Null_Mutex;
28 class ACE_Thread_Mutex;
29 class ACE_Process_Mutex;
30 class ACE_Recursive_Thread_Mutex;
31 class ACE_RW_Thread_Mutex;
32 class ACE_Thread_Semaphore;
34 template <class MUTEX> class ACE_Condition;
35 typedef ACE_Condition<ACE_Null_Mutex> ACE_Null_Condition;
36 typedef ACE_Condition<ACE_Thread_Mutex> ACE_Condition_Thread_Mutex;
37 typedef ACE_Condition<ACE_Recursive_Thread_Mutex> ACE_Condition_Recursive_Thread_Mutex;
39 /**
40 * @class ACE_NULL_SYNCH
42 * @brief Implement a do nothing Synchronization wrapper that
43 * typedefs the @c ACE_Condition and @c ACE_Mutex to the
44 * @c Null* versions.
46 class ACE_Export ACE_NULL_SYNCH
48 public:
49 typedef ACE_Null_Mutex MUTEX;
50 typedef ACE_Null_Mutex NULL_MUTEX;
51 typedef ACE_Null_Mutex PROCESS_MUTEX;
52 typedef ACE_Null_Mutex RECURSIVE_MUTEX;
53 typedef ACE_Null_Mutex RW_MUTEX;
54 typedef ACE_Null_Condition CONDITION;
55 typedef ACE_Null_Condition RECURSIVE_CONDITION;
56 typedef ACE_Null_Semaphore SEMAPHORE;
57 typedef ACE_Null_Mutex NULL_SEMAPHORE;
60 #if defined (ACE_HAS_THREADS)
62 class ACE_Process_Mutex;
64 /**
65 * @class ACE_MT_SYNCH
67 * @brief Implement a default thread safe synchronization wrapper that
68 * typedefs the @c ACE_Condition and @c ACE_Mutex to the
69 * @c ACE_Condition and @c ACE_Mutex versions.
71 * @todo This should be a template, but SunC++ 4.0.1 complains about
72 * this.
74 class ACE_Export ACE_MT_SYNCH
76 public:
77 typedef ACE_Thread_Mutex MUTEX;
78 typedef ACE_Null_Mutex NULL_MUTEX;
79 typedef ACE_Process_Mutex PROCESS_MUTEX;
80 typedef ACE_Recursive_Thread_Mutex RECURSIVE_MUTEX;
81 typedef ACE_RW_Thread_Mutex RW_MUTEX;
82 typedef ACE_Condition_Thread_Mutex CONDITION;
83 typedef ACE_Condition_Recursive_Thread_Mutex RECURSIVE_CONDITION;
84 typedef ACE_Thread_Semaphore SEMAPHORE;
85 typedef ACE_Null_Semaphore NULL_SEMAPHORE;
88 #endif /* ACE_HAS_THREADS */
90 #define ACE_SYNCH_MUTEX ACE_SYNCH::MUTEX
91 #define ACE_SYNCH_NULL_MUTEX ACE_SYNCH::NULL_MUTEX
92 #define ACE_SYNCH_RECURSIVE_MUTEX ACE_SYNCH::RECURSIVE_MUTEX
93 #define ACE_SYNCH_RW_MUTEX ACE_SYNCH::RW_MUTEX
94 #define ACE_SYNCH_CONDITION ACE_SYNCH::CONDITION
95 #define ACE_SYNCH_RECURSIVE_CONDITION ACE_SYNCH::RECURSIVE_CONDITION
96 #define ACE_SYNCH_NULL_SEMAPHORE ACE_SYNCH::NULL_SEMAPHORE
97 #define ACE_SYNCH_SEMAPHORE ACE_SYNCH::SEMAPHORE
99 // These are available on *all* platforms
100 #define ACE_SYNCH_PROCESS_SEMAPHORE ACE_Process_Semaphore
101 #define ACE_SYNCH_PROCESS_MUTEX ACE_Process_Mutex
103 #if defined (ACE_HAS_THREADS)
104 #define ACE_SYNCH ACE_MT_SYNCH
105 #else /* ACE_HAS_THREADS */
106 #define ACE_SYNCH ACE_NULL_SYNCH
107 #endif /* ACE_HAS_THREADS */
109 ACE_END_VERSIONED_NAMESPACE_DECL
111 #include /**/ "ace/post.h"
112 #endif /* ACE_SYNCH_TRAITS_H */