Task.inl

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Task.inl,v 4.8 2006/06/20 19:27:06 shuston Exp
00004 
00005 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00006 
00007 // Get the current group id.
00008 ACE_INLINE int
00009 ACE_Task_Base::grp_id (void) const
00010 {
00011   ACE_TRACE ("ACE_Task_Base::grp_id");
00012   ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, const_cast <ACE_Thread_Mutex&>(this->lock_), -1));
00013   return this->grp_id_;
00014 }
00015 
00016 // Set the current group id.
00017 
00018 ACE_INLINE void
00019 ACE_Task_Base::grp_id (int identifier)
00020 {
00021   ACE_TRACE ("ACE_Task_Base::grp_id");
00022   ACE_MT (ACE_GUARD (ACE_Thread_Mutex, ace_mon, this->lock_));
00023 
00024   // Cache the group id in the task and then set it in the
00025   // Thread_Manager, if there is one.
00026   this->grp_id_ = identifier;
00027   if (this->thr_mgr ())
00028     this->thr_mgr ()->set_grp (this, identifier);
00029 }
00030 
00031 ACE_INLINE ACE_Thread_Manager *
00032 ACE_Task_Base::thr_mgr (void) const
00033 {
00034   ACE_TRACE ("ACE_Task_Base::thr_mgr");
00035   return this->thr_mgr_;
00036 }
00037 
00038 ACE_INLINE void
00039 ACE_Task_Base::thr_mgr (ACE_Thread_Manager *thr_mgr)
00040 {
00041   ACE_TRACE ("ACE_Task_Base::thr_mgr");
00042   this->thr_mgr_ = thr_mgr;
00043 }
00044 
00045 ACE_INLINE int
00046 ACE_Task_Base::is_reader (void) const
00047 {
00048   ACE_TRACE ("ACE_Task_Base::is_reader");
00049   return (ACE_BIT_ENABLED (this->flags_, ACE_Task_Flags::ACE_READER));
00050 }
00051 
00052 ACE_INLINE int
00053 ACE_Task_Base::is_writer (void) const
00054 {
00055   ACE_TRACE ("ACE_Task_Base::is_writer");
00056   return (ACE_BIT_DISABLED (this->flags_, ACE_Task_Flags::ACE_READER));
00057 }
00058 
00059 // Return the count of the current number of threads.
00060 ACE_INLINE size_t
00061 ACE_Task_Base::thr_count (void) const
00062 {
00063   ACE_TRACE ("ACE_Task_Base::thr_count");
00064   ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, const_cast <ACE_Thread_Mutex&>(this->lock_), 0));
00065 
00066   return this->thr_count_;
00067 }
00068 
00069 // Return the thread ID of the last thread to exit svc().
00070 ACE_INLINE ACE_thread_t
00071 ACE_Task_Base::last_thread (void) const
00072 {
00073   ACE_TRACE ("ACE_Task_Base::last_thread");
00074   return this->last_thread_id_;
00075 }
00076 
00077 ACE_END_VERSIONED_NAMESPACE_DECL

Generated on Thu Nov 9 09:42:06 2006 for ACE by doxygen 1.3.6