00001
00002
00003
00004
00005
00006 #include "ace/Trace.h"
00007
00008 ASYS_INLINE int
00009 ACE_SV_Semaphore_Simple::control (int cmd,
00010 semun arg,
00011 u_short n) const
00012 {
00013 ACE_TRACE ("ACE_SV_Semaphore_Simple::control");
00014 return this->internal_id_ == -1 ?
00015 -1 : ACE_OS::semctl (this->internal_id_, n, cmd, arg);
00016 }
00017
00018
00019
00020
00021 ASYS_INLINE int
00022 ACE_SV_Semaphore_Simple::close (void)
00023 {
00024 ACE_TRACE ("ACE_SV_Semaphore_Simple::close");
00025 return this->init ();
00026 }
00027
00028
00029
00030 ASYS_INLINE int
00031 ACE_SV_Semaphore_Simple::op (sembuf op_vec[], u_short n) const
00032 {
00033 ACE_TRACE ("ACE_SV_Semaphore_Simple::op");
00034 return this->internal_id_ == -1
00035 ? -1 : ACE_OS::semop (this->internal_id_, op_vec, n);
00036 }
00037
00038
00039
00040
00041
00042 ASYS_INLINE int
00043 ACE_SV_Semaphore_Simple::acquire (u_short n, int flags) const
00044 {
00045 ACE_TRACE ("ACE_SV_Semaphore_Simple::acquire");
00046 return this->op (-1, n, flags);
00047 }
00048
00049 ASYS_INLINE int
00050 ACE_SV_Semaphore_Simple::acquire_read (u_short n, int flags) const
00051 {
00052 ACE_TRACE ("ACE_SV_Semaphore_Simple::acquire_read");
00053 return this->acquire (n, flags);
00054 }
00055
00056 ASYS_INLINE int
00057 ACE_SV_Semaphore_Simple::acquire_write (u_short n, int flags) const
00058 {
00059 ACE_TRACE ("ACE_SV_Semaphore_Simple::acquire_write");
00060 return this->acquire (n, flags);
00061 }
00062
00063
00064
00065 ASYS_INLINE int
00066 ACE_SV_Semaphore_Simple::tryacquire (u_short n, int flags) const
00067 {
00068 ACE_TRACE ("ACE_SV_Semaphore_Simple::tryacquire");
00069 return this->op (-1, n, flags | IPC_NOWAIT);
00070 }
00071
00072
00073
00074 ASYS_INLINE int
00075 ACE_SV_Semaphore_Simple::tryacquire_read (u_short n, int flags) const
00076 {
00077 ACE_TRACE ("ACE_SV_Semaphore_Simple::tryacquire_read");
00078 return this->tryacquire (n, flags);
00079 }
00080
00081
00082
00083 ASYS_INLINE int
00084 ACE_SV_Semaphore_Simple::tryacquire_write (u_short n, int flags) const
00085 {
00086 ACE_TRACE ("ACE_SV_Semaphore_Simple::tryacquire_write");
00087 return this->tryacquire (n, flags);
00088 }
00089
00090
00091
00092
00093 ASYS_INLINE int
00094 ACE_SV_Semaphore_Simple::release (u_short n, int flags) const
00095 {
00096 ACE_TRACE ("ACE_SV_Semaphore_Simple::release");
00097 return this->op (1, n, flags);
00098 }
00099
00100 ASYS_INLINE int
00101 ACE_SV_Semaphore_Simple::get_id (void) const
00102 {
00103 ACE_TRACE ("ACE_SV_Semaphore_Simple::get_id");
00104 return this->internal_id_;
00105 }
00106