diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2019-08-21 21:22:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-21 21:22:59 +0200 |
commit | eeaf44e81521c55fe39339091fb637118a140f5f (patch) | |
tree | 5a99a37f51091e0ce4cc651c54e7b57b7f2fab01 | |
parent | 2d202cff94a75c03723eef7359dd9f4e1c3c5747 (diff) | |
parent | 109a80d2ce3fac73c5c1b6202c0cd6ccf696e0f9 (diff) | |
download | ATCD-eeaf44e81521c55fe39339091fb637118a140f5f.tar.gz |
Merge pull request #946 from jwillemsen/jwi-devpollreactorownerbool
Changed the owner flag of the dev poll reactor from int to bool
-rw-r--r-- | ACE/ace/Dev_Poll_Reactor.cpp | 4 | ||||
-rw-r--r-- | ACE/ace/Dev_Poll_Reactor.h | 11 | ||||
-rw-r--r-- | ACE/ace/Dev_Poll_Reactor.inl | 10 | ||||
-rw-r--r-- | ACE/ace/TP_Reactor.h | 1 |
4 files changed, 11 insertions, 15 deletions
diff --git a/ACE/ace/Dev_Poll_Reactor.cpp b/ACE/ace/Dev_Poll_Reactor.cpp index 4d85a709297..55cb4d4d5a3 100644 --- a/ACE/ace/Dev_Poll_Reactor.cpp +++ b/ACE/ace/Dev_Poll_Reactor.cpp @@ -2543,7 +2543,7 @@ ACE_Dev_Poll_Reactor::Token_Guard::acquire_quietly (ACE_Time_Value *max_wait) } // We got the token and so let us mark ourselves as owner - this->owner_ = 1; + this->owner_ = true; return result; } @@ -2578,7 +2578,7 @@ ACE_Dev_Poll_Reactor::Token_Guard::acquire (ACE_Time_Value *max_wait) } // We got the token and so let us mark ourseleves as owner - this->owner_ = 1; + this->owner_ = true; return result; } diff --git a/ACE/ace/Dev_Poll_Reactor.h b/ACE/ace/Dev_Poll_Reactor.h index 37798db97ee..25261deba32 100644 --- a/ACE/ace/Dev_Poll_Reactor.h +++ b/ACE/ace/Dev_Poll_Reactor.h @@ -1003,7 +1003,6 @@ protected: short reactor_mask_to_poll_event (ACE_Reactor_Mask mask); protected: - /// Has the reactor been initialized. bool initialized_; @@ -1119,7 +1118,7 @@ protected: /// Returns whether the thread that created this object owns the /// token or not. - int is_owner (void); + bool is_owner (void); /// A helper method that acquires the token 1) at a low priority, and /// 2) wait quietly for the token, not waking another thread. This @@ -1137,16 +1136,14 @@ protected: Token_Guard (void); private: - /// The Reactor token. ACE_Dev_Poll_Reactor_Token &token_; /// Flag that indicate whether the thread that created this object - /// owns the token or not. A value of 0 indicates that this class - /// hasn't got the token (and hence the thread) and a value of 1 + /// owns the token or not. A value of false indicates that this class + /// hasn't got the token (and hence the thread) and a value of true /// vice-versa. - int owner_; - + bool owner_; }; }; diff --git a/ACE/ace/Dev_Poll_Reactor.inl b/ACE/ace/Dev_Poll_Reactor.inl index aedd5705713..2b69631f2c2 100644 --- a/ACE/ace/Dev_Poll_Reactor.inl +++ b/ACE/ace/Dev_Poll_Reactor.inl @@ -97,17 +97,17 @@ ACE_INLINE ACE_Dev_Poll_Reactor::Token_Guard::Token_Guard (ACE_Dev_Poll_Reactor_Token &token) : token_ (token), - owner_ (0) + owner_ (false) { } ACE_INLINE ACE_Dev_Poll_Reactor::Token_Guard::~Token_Guard (void) { - if (this->owner_ == 1) + if (this->owner_) { ACE_MT (this->token_.release ()); - this->owner_ = 0; + this->owner_ = false; } } @@ -119,11 +119,11 @@ ACE_Dev_Poll_Reactor::Token_Guard::release_token (void) ACE_MT (this->token_.release ()); // We are not the owner anymore.. - this->owner_ = 0; + this->owner_ = false; } } -ACE_INLINE int +ACE_INLINE bool ACE_Dev_Poll_Reactor::Token_Guard::is_owner (void) { return this->owner_; diff --git a/ACE/ace/TP_Reactor.h b/ACE/ace/TP_Reactor.h index 15384c0eb6c..c9be2cf15f5 100644 --- a/ACE/ace/TP_Reactor.h +++ b/ACE/ace/TP_Reactor.h @@ -132,7 +132,6 @@ private: /// hasn't got the token (and hence the thread) and a value of true /// vice-versa. bool owner_; - }; /** |