diff options
author | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-07-04 19:27:53 +0000 |
---|---|---|
committer | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-07-04 19:27:53 +0000 |
commit | afaa72956780c7ede0faeb838888a04463155faa (patch) | |
tree | 9daa46ec69210e3c701c865cb532d1727ea0e6c7 | |
parent | 1cec78e1bc3af1d2a2fe2d30823c5c98f80a5ca3 (diff) | |
download | ATCD-afaa72956780c7ede0faeb838888a04463155faa.tar.gz |
ChangeLogTag: Wed Jul 04 14:26:10 2001 Irfan Pyarali <irfan@cs.wustl.edu>
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | ChangeLogs/ChangeLog-02a | 8 | ||||
-rw-r--r-- | ChangeLogs/ChangeLog-03a | 8 | ||||
-rw-r--r-- | ace/Synch_T.h | 48 | ||||
-rw-r--r-- | ace/Synch_T.i | 6 |
5 files changed, 56 insertions, 22 deletions
diff --git a/ChangeLog b/ChangeLog index 86838dd31d2..9a111af4338 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Wed Jul 04 14:26:10 2001 Irfan Pyarali <irfan@cs.wustl.edu> + + * ace/Synch_T.h (class ACE_Acquire_Method): Moved the enums from + the Reverse Lock class into ACE_Acquire_Method, a non-template + class. These enums should have been inside the reverse lock + class, but some lame compilers cannot handle enums inside + template classes. + Wed Jul 04 12:43:22 2001 Irfan Pyarali <irfan@cs.wustl.edu> * ace/Synch_T.i (ACE_Reverse_Lock): Fully specified the diff --git a/ChangeLogs/ChangeLog-02a b/ChangeLogs/ChangeLog-02a index 86838dd31d2..9a111af4338 100644 --- a/ChangeLogs/ChangeLog-02a +++ b/ChangeLogs/ChangeLog-02a @@ -1,3 +1,11 @@ +Wed Jul 04 14:26:10 2001 Irfan Pyarali <irfan@cs.wustl.edu> + + * ace/Synch_T.h (class ACE_Acquire_Method): Moved the enums from + the Reverse Lock class into ACE_Acquire_Method, a non-template + class. These enums should have been inside the reverse lock + class, but some lame compilers cannot handle enums inside + template classes. + Wed Jul 04 12:43:22 2001 Irfan Pyarali <irfan@cs.wustl.edu> * ace/Synch_T.i (ACE_Reverse_Lock): Fully specified the diff --git a/ChangeLogs/ChangeLog-03a b/ChangeLogs/ChangeLog-03a index 86838dd31d2..9a111af4338 100644 --- a/ChangeLogs/ChangeLog-03a +++ b/ChangeLogs/ChangeLog-03a @@ -1,3 +1,11 @@ +Wed Jul 04 14:26:10 2001 Irfan Pyarali <irfan@cs.wustl.edu> + + * ace/Synch_T.h (class ACE_Acquire_Method): Moved the enums from + the Reverse Lock class into ACE_Acquire_Method, a non-template + class. These enums should have been inside the reverse lock + class, but some lame compilers cannot handle enums inside + template classes. + Wed Jul 04 12:43:22 2001 Irfan Pyarali <irfan@cs.wustl.edu> * ace/Synch_T.i (ACE_Reverse_Lock): Fully specified the diff --git a/ace/Synch_T.h b/ace/Synch_T.h index 827d4d1b3a4..b26bb7cd60e 100644 --- a/ace/Synch_T.h +++ b/ace/Synch_T.h @@ -104,6 +104,33 @@ private: }; /** + * @class ACE_Acquire_Method + * + * @brief An enum class. + * + * These enums should have been inside the reverse lock class, but + * some lame compilers cannot handle enums inside template classes. + * + * The METHOD_TYPE is used to indicate which acquire() method will be + * called on the real lock when the release() method is called on the + * reverse lock. REGULAR indicated the acquire() method, READ + * indicates the acquire_read() method, and WRITE indicates the + * acquire_write() method. Note that the try_*() methods are not + * represented here because we have to make sure that the release() + * method on the reverse lock acquires a lock on the real lock. + **/ +class ACE_Acquire_Method +{ +public: + enum METHOD_TYPE + { + ACE_REGULAR, + ACE_READ, + ACE_WRITE + }; +}; + +/** * @class ACE_Reverse_Lock * * @brief A reverse (or anti) lock. @@ -126,30 +153,13 @@ class ACE_Reverse_Lock : public ACE_Lock { public: - /** - * The ACE_ACQUIRE_METHOD is used to indicate which acquire() method - * will be called on the real lock when the release() method is - * called on the reverse lock. REGULAR indicated the acquire() - * method, READ indicates the acquire_read() method, and WRITE - * indicates the acquire_write() method. Note that the try_*() - * methods are not represented here because we have to make sure - * that the release() method on the reverse lock acquires a lock on - * the real lock. - **/ - enum ACE_ACQUIRE_METHOD - { - ACE_REGULAR, - ACE_READ, - ACE_WRITE - }; - typedef ACE_LOCKING_MECHANISM ACE_LOCK; // = Initialization/Finalization methods. /// Constructor. All locking requests will be forwarded to <lock>. ACE_Reverse_Lock (ACE_LOCKING_MECHANISM &lock, - ACE_ACQUIRE_METHOD acquire_method = ACE_REGULAR); + ACE_Acquire_Method::METHOD_TYPE acquire_method = ACE_Acquire_Method::ACE_REGULAR); /// Destructor. If <lock_> was not passed in by the user, it will be /// deleted. @@ -188,7 +198,7 @@ private: ACE_LOCKING_MECHANISM &lock_; /// This indicates what kind of acquire method will be called. - ACE_ACQUIRE_METHOD acquire_method_; + ACE_Acquire_Method::METHOD_TYPE acquire_method_; }; /** diff --git a/ace/Synch_T.i b/ace/Synch_T.i index 5b3116c289e..ef0f225af28 100644 --- a/ace/Synch_T.i +++ b/ace/Synch_T.i @@ -259,7 +259,7 @@ ACE_Lock_Adapter<ACE_LOCKING_MECHANISM>::tryacquire_write_upgrade (void) template <class ACE_LOCKING_MECHANISM> ACE_INLINE ACE_Reverse_Lock<ACE_LOCKING_MECHANISM>::ACE_Reverse_Lock (ACE_LOCKING_MECHANISM &lock, - ACE_Reverse_Lock<ACE_LOCKING_MECHANISM>::ACE_ACQUIRE_METHOD acquire_method) + ACE_Acquire_Method::METHOD_TYPE acquire_method) : lock_ (lock), acquire_method_ (acquire_method) { @@ -290,9 +290,9 @@ ACE_Reverse_Lock<ACE_LOCKING_MECHANISM>::tryacquire (void) template <class ACE_LOCKING_MECHANISM> ACE_INLINE int ACE_Reverse_Lock<ACE_LOCKING_MECHANISM>::release (void) { - if (this->acquire_method_ == ACE_READ) + if (this->acquire_method_ == ACE_Acquire_Method::ACE_READ) return this->lock_.acquire_read (); - else if (this->acquire_method_ == ACE_WRITE) + else if (this->acquire_method_ == ACE_Acquire_Method::ACE_WRITE) return this->lock_.acquire_write (); else return this->lock_.acquire (); |