00001 #include "ace_pch.h"
00002
00003
00004 #include "ace/Process_Semaphore.h"
00005 #include "ace/Log_Msg.h"
00006
00007 #if !defined (__ACE_INLINE__)
00008 #include "ace/Process_Semaphore.inl"
00009 #endif
00010
00011 ACE_RCSID(ace, Process_Semaphore, "$Id: Process_Semaphore.cpp,v 1.1.1.1.40.1 2003/03/13 19:44:22 chad Exp $")
00012
00013 void
00014 ACE_Process_Semaphore::dump (void) const
00015 {
00016
00017 ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
00018 this->lock_.dump ();
00019 ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
00020 }
00021
00022 ACE_Process_Semaphore::ACE_Process_Semaphore (u_int count,
00023 const ACE_TCHAR *name,
00024 void *arg,
00025 int max)
00026 #if defined (ACE_WIN32) || defined (ACE_HAS_POSIX_SEM) || defined (ACE_PSOS)
00027 : lock_ (count, USYNC_PROCESS, name, arg, max)
00028 #else
00029 : lock_ (name, ACE_SV_Semaphore_Complex::ACE_CREATE, count)
00030 #endif
00031 {
00032 arg = arg;
00033 max = max;
00034
00035 }
00036
00037 ACE_Process_Semaphore::~ACE_Process_Semaphore (void)
00038 {
00039
00040 }
00041
00042
00043
00044 int
00045 ACE_Process_Semaphore::remove (void)
00046 {
00047
00048 return this->lock_.remove ();
00049 }
00050
00051
00052
00053
00054 int
00055 ACE_Process_Semaphore::acquire (void)
00056 {
00057
00058 return this->lock_.acquire ();
00059 }
00060
00061
00062
00063
00064 int
00065 ACE_Process_Semaphore::tryacquire (void)
00066 {
00067
00068 return this->lock_.tryacquire ();
00069 }
00070
00071
00072
00073
00074 int
00075 ACE_Process_Semaphore::release (void)
00076 {
00077
00078 return this->lock_.release ();
00079 }
00080
00081
00082
00083
00084 #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
00085
00086
00087
00088 #elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
00089
00090
00091
00092 #endif