00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 #ifndef ACE_THREAD_SEMAPHORE_H
00016 #define ACE_THREAD_SEMAPHORE_H
00017 #include  "ace/pre.h"
00018 
00019 #include  "ace/ACE_export.h"
00020 
00021 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00022 # pragma once
00023 #endif 
00024 
00025 #if !defined (ACE_HAS_THREADS)
00026 #  include "ace/Null_Semaphore.h"
00027 #else 
00028 
00029 
00030 #include "ace/Semaphore.h"
00031 
00032 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00033 
00034 
00035 
00036 
00037 
00038 
00039 
00040 class ACE_Export ACE_Thread_Semaphore : public ACE_Semaphore
00041 {
00042 public:
00043 
00044 
00045   ACE_Thread_Semaphore (unsigned int count = 1, 
00046                         const ACE_TCHAR *name = 0,
00047                         void * = 0,
00048                         int max = 0x7FFFFFFF);
00049 
00050 
00051   ~ACE_Thread_Semaphore (void);
00052 
00053 
00054   void dump (void) const;
00055 
00056 
00057   ACE_ALLOC_HOOK_DECLARE;
00058 };
00059 
00060 
00061 
00062 template <class T> class ACE_Malloc_Lock_Adapter_T;
00063 
00064 
00065 
00066 
00067 
00068 
00069 
00070 
00071 
00072 
00073 template<>
00074 class ACE_Export ACE_Malloc_Lock_Adapter_T<ACE_Thread_Semaphore>
00075 {
00076 public:
00077   ACE_Thread_Semaphore * operator () (const ACE_TCHAR *name);
00078 };
00079 
00080 ACE_END_VERSIONED_NAMESPACE_DECL
00081 
00082 #if defined (__ACE_INLINE__)
00083 #include "ace/Thread_Semaphore.inl"
00084 #endif 
00085 
00086 #endif 
00087 
00088 #include  "ace/post.h"
00089 #endif