summaryrefslogtreecommitdiff
path: root/ace/Task.h
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>1996-11-01 08:40:32 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>1996-11-01 08:40:32 +0000
commit76171efcb983b4f2ff55a4013fed794f7a9bb471 (patch)
treea817b83efdc199c8f292b9a5bfd4047ef900f6b0 /ace/Task.h
parentbad6c3a7b49b64377c60931084a6ef68ae64877b (diff)
downloadATCD-76171efcb983b4f2ff55a4013fed794f7a9bb471.tar.gz
foo
Diffstat (limited to 'ace/Task.h')
-rw-r--r--ace/Task.h117
1 files changed, 6 insertions, 111 deletions
diff --git a/ace/Task.h b/ace/Task.h
index e608ee4471b..bc254fa481f 100644
--- a/ace/Task.h
+++ b/ace/Task.h
@@ -1,7 +1,6 @@
/* -*- C++ -*- */
// $Id$
-
// ============================================================================
//
// = LIBRARY
@@ -19,12 +18,7 @@
#define ACE_TASK_H
#include "ace/Service_Object.h"
-#include "ace/Message_Queue.h"
#include "ace/Thread_Manager.h"
-#include "ace/Synch_T.h"
-
-// Forward decls...
-template <ACE_SYNCH_1> class ACE_Module;
class ACE_Task_Flags
// = TITLE
@@ -111,10 +105,6 @@ public:
void thr_mgr (ACE_Thread_Manager *);
// Set the thread manager associated with this Task.
- size_t thr_count (void);
- // Returns the number of threads currently running within a task.
- // If we're a passive object this value is 0, else it's > 0.
-
static void *svc_run (ACE_Task_Base *);
// Routine that runs the service routine as a daemon thread.
@@ -124,6 +114,10 @@ public:
int is_writer (void);
// True if queue is a writer, else false.
+ size_t thr_count (void);
+ // Returns the number of threads currently running within a task.
+ // If we're a passive object this value is 0, else it's > 0.
+
void thr_count_dec (void);
// Atomically decrement the thread count by 1. This should only be
// called by the <ACE_Task_Exit> class destructor.
@@ -153,100 +147,6 @@ public:
#endif /* ACE_MT_SAFE */
};
-template <ACE_SYNCH_1>
-class ACE_Task : public ACE_Task_Base
- // = TITLE
- // Primary interface for application message processing, as well
- // as input and output message queueing.
- //
- // = DESCRIPTION
- // This class serves as the basis for passive and active objects
- // in ACE.
-{
-friend class ACE_Module<ACE_SYNCH_2>;
-friend class ACE_Module_Type;
-public:
- // = Initialization/termination methods.
- ACE_Task (ACE_Thread_Manager *thr_mgr = 0,
- ACE_Message_Queue<ACE_SYNCH_2> *mq = 0);
- // Initialize a Task, supplying a thread manager and a message
- // queue. If the user doesn't supply a ACE_Message_Queue pointer
- // then we'll allocate one dynamically. Otherwise, we'll use the
- // one they give.
-
- virtual ~ACE_Task (void);
- // Destructor.
-
- ACE_Message_Queue<ACE_SYNCH_2> *msg_queue (void);
- // Gets the message queue associated with this task.
-
- void msg_queue (ACE_Message_Queue<ACE_SYNCH_2> *);
- // Sets the message queue associated with this task.
-
-public: // Should be protected:
- // = Message queue manipulation methods.
-
- int putq (ACE_Message_Block *, ACE_Time_Value *tv = 0);
- // Insert message into the message list.
-
- int getq (ACE_Message_Block *&mb, ACE_Time_Value *tv = 0);
- // Extract the first message from the list (blocking).
-
- int ungetq (ACE_Message_Block *, ACE_Time_Value *tv = 0);
- // Return a message to the queue.
-
- int can_put (ACE_Message_Block *);
- // Tests whether we can enqueue a message without blocking.
-
- int reply (ACE_Message_Block *, ACE_Time_Value *tv = 0);
- // Turn the message back around.
-
- int put_next (ACE_Message_Block *msg, ACE_Time_Value *tv = 0);
- // Transfer message to the adjacent ACE_Task in a ACE_Stream.
-
- // = ACE_Task utility routines to identify names et al.
- const char *name (void) const;
- // Return the name of the enclosing Module if there's one associated
- // with the Task, else returns 0.
-
- // = Pointers to next ACE_Task_Base (if ACE is part of an ACE_Stream).
- ACE_Task<ACE_SYNCH_2> *next (void);
- // Get next Task pointer.
- void next (ACE_Task<ACE_SYNCH_2> *);
- // Set next Task pointer.
-
- ACE_Task<ACE_SYNCH_2> *sibling (void);
- // Return the Task's sibling if there's one associated with the
- // Task's Module, else returns 0.
-
- ACE_Module<ACE_SYNCH_2> *module (void) const;
- // Return the Task's Module if there is one, else returns 0.
-
- int flush (u_long flag = ACE_Task_Flags::ACE_FLUSHALL); /* Flush the queue */
- // Special routines corresponding to certain message types.
-
- void water_marks (ACE_IO_Cntl_Msg::ACE_IO_Cntl_Cmds, size_t);
- // Manipulate watermarks.
-
- ACE_Message_Queue<ACE_SYNCH_2> *msg_queue_;
- // List of messages on the ACE_Task..
-
- int delete_msg_queue_;
- // 1 if should delete Message_Queue, 0 otherwise.
-
- ACE_Module<ACE_SYNCH_2> *mod_;
- // Back-pointer to the enclosing module.
-
- ACE_Task<ACE_SYNCH_2> *next_;
- // Pointer to adjacent ACE_Task.
-
- void dump (void) const;
- // Dump the state of an object.
-
- ACE_ALLOC_HOOK_DECLARE;
- // Declare the dynamic allocation hooks.
-};
-
class ACE_Task_Exit
// = TITLE
// Keep exit information for a Task in thread specific storage so
@@ -303,12 +203,7 @@ private:
#include "ace/Task.i"
#endif /* __ACE_INLINE__ */
-#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
-#include "ace/Task.cpp"
-#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
-
-#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
-#pragma implementation ("Task.cpp")
-#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+// Include the ACE_Task templates classes at this point.
+#include "ace/Task_T.h"
#endif /* ACE_TASK_H */