summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/Notify/ThreadPool_Task.h
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/orbsvcs/orbsvcs/Notify/ThreadPool_Task.h')
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/ThreadPool_Task.h50
1 files changed, 15 insertions, 35 deletions
diff --git a/TAO/orbsvcs/orbsvcs/Notify/ThreadPool_Task.h b/TAO/orbsvcs/orbsvcs/Notify/ThreadPool_Task.h
index 7c6ad778e5d..ffff9d3a1a6 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/ThreadPool_Task.h
+++ b/TAO/orbsvcs/orbsvcs/Notify/ThreadPool_Task.h
@@ -1,12 +1,11 @@
-/* -*- C++ -*- */
+// -*- C++ -*-
+
/**
* @file ThreadPool_Task.h
*
* $Id$
*
* @author Pradeep Gore <pradeep@oomworks.com>
- *
- *
*/
#ifndef TAO_Notify_THREADPOOL_TASK_H
@@ -14,20 +13,23 @@
#include /**/ "ace/pre.h"
-#include "notify_serv_export.h"
+#include "orbsvcs/Notify/notify_serv_export.h"
-#include "Timer_Queue.h"
-#include "AdminProperties.h"
-#include "Worker_Task.h"
+#include "orbsvcs/Notify/Timer_Queue.h"
+#include "orbsvcs/Notify/AdminProperties.h"
+#include "orbsvcs/Notify/Worker_Task.h"
#include "ace/Task.h"
#include "ace/Message_Queue.h"
#include "ace/Reactor.h"
+#include "ace/Null_Condition.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
class TAO_Notify_Buffering_Strategy;
/**
@@ -36,7 +38,9 @@ class TAO_Notify_Buffering_Strategy;
* @brief Implements a Thread Pool Worker Task.
*
*/
-class TAO_Notify_Serv_Export TAO_Notify_ThreadPool_Task : public TAO_Notify_Worker_Task, public ACE_Task<ACE_NULL_SYNCH>
+class TAO_Notify_Serv_Export TAO_Notify_ThreadPool_Task
+ : public TAO_Notify_Worker_Task
+ , public ACE_Task<ACE_NULL_SYNCH>
{
friend class TAO_Notify_Method_Request_Shutdown;
@@ -54,7 +58,7 @@ public:
virtual int close (u_long flags);
/// Activate the threadpool
- void init (const NotifyExt::ThreadPoolParams& tp_params, TAO_Notify_AdminProperties::Ptr& admin_properties ACE_ENV_ARG_DECL);
+ void init (const NotifyExt::ThreadPoolParams& tp_params, const TAO_Notify_AdminProperties::Ptr& admin_properties ACE_ENV_ARG_DECL);
/// Queue the request
virtual void execute (TAO_Notify_Method_Request& method_request ACE_ENV_ARG_DECL);
@@ -76,9 +80,6 @@ private:
/// Release
virtual void release (void);
- /// wait for all threads to exit svc()
- virtual void wait_for_shutdown ();
-
/// The buffering strategy to use.
ACE_Auto_Ptr< TAO_Notify_Buffering_Strategy > buffering_strategy_;
@@ -87,31 +88,10 @@ private:
/// The Queue based timer.
TAO_Notify_Timer_Queue::Ptr timer_;
+};
- // Since this class already inherited from ACE_Event_Handler
- // I did not want to conflict with a possible parent
- /// implementation of handle_exception.
- class Shutdown_Handler : public ACE_Event_Handler
- {
- public:
- Shutdown_Handler (TAO_Notify_ThreadPool_Task* owner) : owner_ (owner) {};
-
- /// wait for all threads to complete in another thread
- virtual int handle_exception (ACE_HANDLE fd = ACE_INVALID_HANDLE)
- {
- ACE_UNUSED_ARG (fd);
- owner_->wait_for_shutdown ();
- return 0;
- }
- private:
- TAO_Notify_ThreadPool_Task* owner_;
- };
-
- friend class Shutdown_Handler;
-
- Shutdown_Handler shutdown_handler_;
-};
+TAO_END_VERSIONED_NAMESPACE_DECL
#include /**/ "ace/post.h"