diff options
Diffstat (limited to 'ace/Task.i')
-rw-r--r-- | ace/Task.i | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/ace/Task.i b/ace/Task.i index 7e682513761..798606a68ae 100644 --- a/ace/Task.i +++ b/ace/Task.i @@ -4,7 +4,7 @@ // Task.i ACE_INLINE ACE_Thread_Manager * -ACE_Task_Base::thr_mgr (void) +ACE_Task_Base::thr_mgr (void) const { ACE_TRACE ("ACE_Task_Base::thr_mgr"); return this->thr_mgr_; @@ -19,10 +19,10 @@ ACE_Task_Base::thr_mgr (ACE_Thread_Manager *thr_mgr) // Return the count of the current number of threads. ACE_INLINE size_t -ACE_Task_Base::thr_count (void) +ACE_Task_Base::thr_count (void) const { ACE_TRACE ("ACE_Task_Base::thr_count"); - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, 0)); + ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, (ACE_Thread_Mutex &) this->lock_, 0)); return this->thr_count_; } @@ -39,14 +39,14 @@ ACE_Task_Base::thr_count_dec (void) } ACE_INLINE int -ACE_Task_Base::is_reader (void) +ACE_Task_Base::is_reader (void) const { ACE_TRACE ("ACE_Task_Base::is_reader"); return (ACE_BIT_ENABLED (this->flags_, ACE_Task_Flags::ACE_READER)); } ACE_INLINE int -ACE_Task_Base::is_writer (void) +ACE_Task_Base::is_writer (void) const { ACE_TRACE ("ACE_Task_Base::is_writer"); return (ACE_BIT_DISABLED (this->flags_, ACE_Task_Flags::ACE_READER)); @@ -87,3 +87,22 @@ ACE_Task_Base::put (ACE_Message_Block *, ACE_Time_Value *) ACE_TRACE ("ACE_Task_Base::put"); return 0; } + +// Get the current group id. +ACE_INLINE int +ACE_Task_Base::grp_id (void) const +{ + ACE_TRACE ("ACE_Task_Base::grp_id"); + ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, (ACE_Thread_Mutex &) this->lock_, -1)); + return this->grp_id_; +} + +// Set the current group id. +ACE_INLINE void +ACE_Task_Base::grp_id (int id) +{ + ACE_TRACE ("ACE_Task_Base::grp_id"); + ACE_MT (ACE_GUARD (ACE_Thread_Mutex, ace_mon, this->lock_)); + this->grp_id_ = id; +} + |