00001
00002
00003
00004
00005 #if defined (ACE_HAS_TOKENS_LIBRARY)
00006
00007 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00008
00009
00010
00011 ACE_INLINE int
00012 ACE_Token_Proxy_Queue::size (void)
00013 {
00014 ACE_TRACE ("ACE_Token_Proxy_Queue::size");
00015 return this->size_;
00016 }
00017
00018
00019
00020 ACE_INLINE int
00021 ACE_TPQ_Entry::waiting (void) const
00022 {
00023 ACE_TRACE ("ACE_TPQ_Entry::waiting");
00024 return waiting_;
00025 }
00026
00027 ACE_INLINE void
00028 ACE_TPQ_Entry::waiting (int v)
00029 {
00030 ACE_TRACE ("ACE_TPQ_Entry::waiting");
00031 waiting_ = v;
00032 }
00033
00034 ACE_INLINE const ACE_TCHAR *
00035 ACE_TPQ_Entry::client_id (void) const
00036 {
00037 ACE_TRACE ("ACE_TPQ_Entry::client_id");
00038 return this->client_id_;
00039 }
00040
00041 ACE_INLINE ACE_Token_Proxy *
00042 ACE_TPQ_Entry::proxy (void) const
00043 {
00044 ACE_TRACE ("ACE_TPQ_Entry::proxy");
00045 return this->proxy_;
00046 }
00047
00048 ACE_INLINE void
00049 ACE_TPQ_Entry::proxy (ACE_Token_Proxy *proxy)
00050 {
00051 ACE_TRACE ("ACE_TPQ_Entry::proxy");
00052 this->proxy_ = proxy;
00053 }
00054
00055 ACE_INLINE
00056 ACE_TPQ_Iterator::~ACE_TPQ_Iterator (void)
00057 {
00058 }
00059
00060 ACE_INLINE
00061 ACE_Token_Proxy_Queue::~ACE_Token_Proxy_Queue (void)
00062 {
00063 }
00064
00065 ACE_INLINE void
00066 ACE_Tokens::remove (ACE_TPQ_Entry *caller)
00067 {
00068 this->waiters_.remove (caller);
00069 }
00070
00071 ACE_INLINE int
00072 ACE_Tokens::dec_reference (void)
00073 {
00074 ACE_TRACE ("ACE_Tokens::dec_reference");
00075 if (this->reference_count_ == 0)
00076 {
00077 ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("dec_reference already zero")));
00078 return 0;
00079 }
00080
00081 return --this->reference_count_;
00082 }
00083
00084 ACE_INLINE void
00085 ACE_Tokens::inc_reference (void)
00086 {
00087 ACE_TRACE ("ACE_Tokens::inc_reference");
00088 ++this->reference_count_;
00089 }
00090
00091 ACE_INLINE const ACE_TPQ_Entry *
00092 ACE_Token_Proxy_Queue::head (void)
00093 {
00094 ACE_TRACE ("ACE_Token_Proxy_Queue::head");
00095 if (this->head_ == 0)
00096 return 0;
00097 else
00098 return this->head_;
00099 }
00100
00101
00102
00103
00104
00105 ACE_INLINE void
00106 ACE_Tokens::visit (int v)
00107 {
00108 ACE_TRACE ("ACE_Tokens::visit");
00109 visited_ = v;
00110 }
00111
00112 ACE_INLINE int
00113 ACE_Tokens::visited (void)
00114 {
00115 ACE_TRACE ("ACE_Tokens::visited");
00116 return visited_;
00117 }
00118
00119 ACE_INLINE ACE_TPQ_Entry *
00120 ACE_Tokens::owner (void)
00121 {
00122 ACE_TRACE ("ACE_Tokens::owner");
00123 return (ACE_TPQ_Entry *) this->waiters_.head ();
00124 }
00125
00126 ACE_INLINE const ACE_TCHAR*
00127 ACE_Tokens::owner_id ()
00128 {
00129 ACE_TRACE ("ACE_Tokens::owner_id");
00130 if (this->owner () == 0)
00131 return ACE_LIB_TEXT ("no owner");
00132 else
00133 return this->owner ()->client_id ();
00134 }
00135
00136 ACE_INLINE const ACE_TCHAR*
00137 ACE_Tokens::name (void)
00138 {
00139 ACE_TRACE ("ACE_Tokens::name");
00140 return this->token_name_;
00141 }
00142
00143 #if 0
00144 ACE_INLINE ACE_Token_Proxy *
00145 ACE_Tokens::current_owner (void)
00146 {
00147 ACE_TRACE ("ACE_Tokens::current_owner");
00148
00149
00150 if (this->owner () == 0)
00151 return 0;
00152 else
00153 return this->owner ()->proxy ();
00154 }
00155 #endif
00156
00157
00158
00159 ACE_INLINE int
00160 ACE_TPQ_Entry::nesting_level (void) const
00161 {
00162 ACE_TRACE ("ACE_TPQ_Entry::nesting_level");
00163 return this->nesting_level_;
00164 }
00165
00166 ACE_INLINE void
00167 ACE_TPQ_Entry::nesting_level (int delta)
00168 {
00169 ACE_TRACE ("ACE_TPQ_Entry::nesting_level");
00170 this->nesting_level_ += delta;
00171 }
00172
00173 ACE_INLINE ACE_TPQ_Entry::PTVF
00174 ACE_TPQ_Entry::sleep_hook (void) const
00175 {
00176 ACE_TRACE ("ACE_TPQ_Entry::sleep_hook");
00177 return this->sleep_hook_;
00178 }
00179
00180 ACE_INLINE void
00181 ACE_TPQ_Entry::sleep_hook (void (*sh)(void *))
00182 {
00183 ACE_TRACE ("ACE_TPQ_Entry::sleep_hook");
00184 this->sleep_hook_ = sh;
00185 }
00186
00187 ACE_INLINE void
00188 ACE_TPQ_Entry::call_sleep_hook (void)
00189 {
00190 ACE_TRACE ("ACE_TPQ_Entry::call_sleep_hook");
00191
00192
00193 if (this->sleep_hook () != 0)
00194 this->sleep_hook () ((void *) this->proxy ());
00195 else
00196
00197 this->proxy ()->sleep_hook ();
00198 }
00199
00200 ACE_INLINE int
00201 ACE_TPQ_Entry::equal_client_id (const ACE_TCHAR *id)
00202 {
00203 ACE_TRACE ("ACE_TPQ_Entry::equal_client_id");
00204 return (ACE_OS::strcmp (this->client_id (), id) == 0);
00205 }
00206
00207
00208
00209
00210
00211 ACE_INLINE
00212 ACE_Local_Mutex::ACE_Local_Mutex (const ACE_TCHAR *token_name,
00213 int ignore_deadlock,
00214 int debug)
00215 {
00216 ACE_TRACE ("ACE_Local_Mutex::ACE_Local_Mutex");
00217 this->open (token_name, ignore_deadlock, debug);
00218 }
00219
00220 ACE_INLINE void
00221 ACE_Token_Name::name (const ACE_TCHAR *new_name)
00222 {
00223 ACE_TRACE ("ACE_Token_Name::name");
00224
00225 if (new_name == 0)
00226 new_name = ACE_LIB_TEXT ("no name");
00227
00228 int n = ACE_OS::strlen (new_name) + 1;
00229
00230 if (n >= ACE_MAXTOKENNAMELEN)
00231 n = ACE_MAXTOKENNAMELEN - 1;
00232
00233 ACE_OS::strsncpy (this->token_name_, (ACE_TCHAR *) new_name, n);
00234 }
00235
00236 ACE_INLINE const ACE_TCHAR*
00237 ACE_Token_Name::name (void) const
00238 {
00239 ACE_TRACE ("ACE_Token_Name::name");
00240 return this->token_name_;
00241 }
00242
00243
00244
00245 ACE_INLINE
00246 ACE_Local_RLock::ACE_Local_RLock (const ACE_TCHAR *token_name,
00247 int ignore_deadlock,
00248 int debug)
00249 {
00250 ACE_TRACE ("ACE_Local_RLock::ACE_Local_RLock");
00251 this->open (token_name, ignore_deadlock, debug);
00252 }
00253
00254
00255
00256 ACE_INLINE
00257 ACE_Local_WLock::ACE_Local_WLock (const ACE_TCHAR *token_name,
00258 int ignore_deadlock,
00259 int debug)
00260 {
00261 ACE_TRACE ("ACE_Local_WLock::ACE_Local_WLock");
00262 this->open (token_name, ignore_deadlock, debug);
00263 }
00264
00265
00266
00267
00268 ACE_INLINE void
00269 ACE_Token_Name::operator= (const ACE_Token_Name &rhs)
00270 {
00271 ACE_TRACE ("ACE_Token_Name::operator=");
00272 if (&rhs == this)
00273 return;
00274 else
00275 this->name (rhs.name ());
00276 }
00277
00278 ACE_INLINE bool
00279 ACE_Token_Name::operator== (const ACE_Token_Name &rhs) const
00280 {
00281 ACE_TRACE ("ACE_Token_Name::operator==");
00282
00283
00284 return (ACE_OS::strcmp (this->token_name_, rhs.name ()) == 0);
00285 }
00286
00287 ACE_END_VERSIONED_NAMESPACE_DECL
00288
00289 #endif