00001 // -*- C++ -*- 00002 // 00003 // Process_Semaphore.inl,v 4.3 2006/05/30 13:15:25 schmidt Exp 00004 00005 ACE_BEGIN_VERSIONED_NAMESPACE_DECL 00006 00007 #if defined (ACE_WIN32) || defined (ACE_HAS_POSIX_SEM) 00008 ACE_INLINE const ACE_sema_t & 00009 ACE_Process_Semaphore::lock (void) const 00010 { 00011 // ACE_TRACE ("ACE_Process_Semaphore::lock"); 00012 return this->lock_.lock (); 00013 } 00014 #endif /* ACE_WIN32 || ACE_HAS_POSIX_SEM */ 00015 00016 // Acquire semaphore ownership. This calls <acquire> and is only here 00017 // to make the <ACE_Process_Semaphore> interface consistent with the 00018 // other synchronization APIs. 00019 00020 ACE_INLINE int 00021 ACE_Process_Semaphore::acquire_read (void) 00022 { 00023 return this->acquire (); 00024 } 00025 00026 // Acquire semaphore ownership. This calls <acquire> and is only here 00027 // to make the <ACE_Process_Semaphore> interface consistent with the 00028 // other synchronization APIs. 00029 00030 ACE_INLINE int 00031 ACE_Process_Semaphore::acquire_write (void) 00032 { 00033 return this->acquire (); 00034 } 00035 00036 // Conditionally acquire semaphore (i.e., won't block). This calls 00037 // <tryacquire> and is only here to make the <ACE_Process_Semaphore> 00038 // interface consistent with the other synchronization APIs. 00039 00040 ACE_INLINE int 00041 ACE_Process_Semaphore::tryacquire_read (void) 00042 { 00043 return this->tryacquire (); 00044 } 00045 00046 // Conditionally acquire semaphore (i.e., won't block). This calls 00047 // <tryacquire> and is only here to make the <ACE_Process_Semaphore> 00048 // interface consistent with the other synchronization APIs. 00049 00050 ACE_INLINE int 00051 ACE_Process_Semaphore::tryacquire_write (void) 00052 { 00053 return this->tryacquire (); 00054 } 00055 00056 // This is only here to make the <ACE_Process_Semaphore> 00057 // interface consistent with the other synchronization APIs. 00058 // Assumes the caller has already acquired the semaphore using one of 00059 // the above calls, and returns 0 (success) always. 00060 ACE_INLINE int 00061 ACE_Process_Semaphore::tryacquire_write_upgrade (void) 00062 { 00063 return 0; 00064 } 00065 00066 ACE_END_VERSIONED_NAMESPACE_DECL