Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

Task.i

Go to the documentation of this file.
00001 /* -*- C++ -*- */
00002 // $Id: Task.i,v 1.1.1.2 2001/12/04 14:33:10 chad Exp $
00003 
00004 // Task.i
00005 
00006 ACE_INLINE ACE_Thread_Manager *
00007 ACE_Task_Base::thr_mgr (void) const
00008 {
00009   ACE_TRACE ("ACE_Task_Base::thr_mgr");
00010   return this->thr_mgr_;
00011 }
00012 
00013 ACE_INLINE void
00014 ACE_Task_Base::thr_mgr (ACE_Thread_Manager *thr_mgr)
00015 {
00016   ACE_TRACE ("ACE_Task_Base::thr_mgr");
00017   this->thr_mgr_ = thr_mgr;
00018 }
00019 
00020 // Return the count of the current number of threads.
00021 ACE_INLINE size_t
00022 ACE_Task_Base::thr_count (void) const
00023 {
00024   ACE_TRACE ("ACE_Task_Base::thr_count");
00025   ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, (ACE_Thread_Mutex &) this->lock_, 0));
00026 
00027   return this->thr_count_;
00028 }
00029 
00030 // Decrement the count of the active threads by 1.
00031 
00032 ACE_INLINE void
00033 ACE_Task_Base::thr_count_dec (void)
00034 {
00035   ACE_TRACE ("ACE_Task_Base::thr_count_dec");
00036   ACE_MT (ACE_GUARD (ACE_Thread_Mutex, ace_mon, this->lock_));
00037 
00038   this->thr_count_--;
00039 }
00040 
00041 ACE_INLINE int
00042 ACE_Task_Base::is_reader (void) const
00043 {
00044   ACE_TRACE ("ACE_Task_Base::is_reader");
00045   return (ACE_BIT_ENABLED (this->flags_, ACE_Task_Flags::ACE_READER));
00046 }
00047 
00048 ACE_INLINE int
00049 ACE_Task_Base::is_writer (void) const
00050 {
00051   ACE_TRACE ("ACE_Task_Base::is_writer");
00052   return (ACE_BIT_DISABLED (this->flags_, ACE_Task_Flags::ACE_READER));
00053 }
00054 
00055 // Default ACE_Task service routine
00056 
00057 ACE_INLINE int
00058 ACE_Task_Base::svc (void)
00059 {
00060   ACE_TRACE ("ACE_Task_Base::svc");
00061   return 0;
00062 }
00063 
00064 // Default ACE_Task open routine
00065 
00066 ACE_INLINE int
00067 ACE_Task_Base::open (void *)
00068 {
00069   ACE_TRACE ("ACE_Task_Base::open");
00070   return 0;
00071 }
00072 
00073 // Default ACE_Task close routine
00074 
00075 ACE_INLINE int
00076 ACE_Task_Base::close (u_long)
00077 {
00078   ACE_TRACE ("ACE_Task_Base::close");
00079   return 0;
00080 }
00081 
00082 // Default ACE_Task put routine.
00083 
00084 ACE_INLINE int
00085 ACE_Task_Base::put (ACE_Message_Block *, ACE_Time_Value *)
00086 {
00087   ACE_TRACE ("ACE_Task_Base::put");
00088   return 0;
00089 }
00090 
00091 // Get the current group id.
00092 ACE_INLINE int
00093 ACE_Task_Base::grp_id (void) const
00094 {
00095   ACE_TRACE ("ACE_Task_Base::grp_id");
00096   ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, (ACE_Thread_Mutex &) this->lock_, -1));
00097   return this->grp_id_;
00098 }
00099 
00100 // Set the current group id.
00101 
00102 ACE_INLINE void
00103 ACE_Task_Base::grp_id (int id)
00104 {
00105   ACE_TRACE ("ACE_Task_Base::grp_id");
00106   ACE_MT (ACE_GUARD (ACE_Thread_Mutex, ace_mon, this->lock_));
00107 
00108   // Cache the group id in the task and then set it in the
00109   // Thread_Manager, if there is one.
00110   this->grp_id_ = id;
00111   if (this->thr_mgr ())
00112     this->thr_mgr ()->set_grp (this, id);
00113 }
00114 

Generated on Mon Jun 16 11:21:44 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002