summaryrefslogtreecommitdiff
path: root/ace/Task.cpp
diff options
context:
space:
mode:
authorlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-07-31 21:48:20 +0000
committerlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-07-31 21:48:20 +0000
commit86c5f836d1a679208716a422839d7da38ba41059 (patch)
tree1b3da514a0eb2064d0b27c62011db9492387b7dc /ace/Task.cpp
parent13c10349a654c59c85bb62c7f7b9ab8e1424814c (diff)
downloadATCD-86c5f836d1a679208716a422839d7da38ba41059.tar.gz
added ACE_HAS_INSTANTIATION_PRAGMA support
Diffstat (limited to 'ace/Task.cpp')
-rw-r--r--ace/Task.cpp40
1 files changed, 24 insertions, 16 deletions
diff --git a/ace/Task.cpp b/ace/Task.cpp
index d0995abe77b..c4ab1a39048 100644
--- a/ace/Task.cpp
+++ b/ace/Task.cpp
@@ -10,12 +10,13 @@
#include "ace/Task.i"
#endif /* __ACE_INLINE__ */
-#if defined (ACE_TEMPLATES_REQUIRE_SPECIALIZATION)
+#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) || defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
#if (defined (ACE_HAS_THREADS) && defined (ACE_HAS_THREAD_SPECIFIC_STORAGE))
// For template specializations at end of this file.
#include "ace/Dynamic.h"
#endif /* ACE_HAS_THREADS && ACE_HAS_THREAD_SPECIFIC_STORAGE */
-#endif /* ACE_TEMPLATES_REQUIRE_SPECIALIZATION */
+#endif /* ACE_HAS_EXPLICT_TEMPLATE_INSTANTIATION */
+
#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0)
// Lock the creation of the Singleton.
@@ -31,7 +32,7 @@ ACE_Task_Exit::instance (void)
{
ACE_TRACE ("ACE_Task_Exit::instance");
- // Determines if we were dynamically allocated.
+ // Determines if we were dynamically allocated.
static ACE_TSS_TYPE (ACE_Task_Exit) *instance_;
// Implement the Double Check pattern.
@@ -54,7 +55,7 @@ ACE_Task_Exit::instance (void)
// destructor.
ACE_Task_Exit::ACE_Task_Exit (void)
- : t_ (0),
+ : t_ (0),
status_ ((void *) -1)
{
ACE_TRACE ("ACE_Task_Exit::ACE_Task_Exit");
@@ -125,7 +126,7 @@ ACE_Task_Base::ACE_Task_Base (ACE_Thread_Manager *thr_man)
}
// Wait for all threads running in a task to exit.
-int
+int
ACE_Task_Base::wait (void)
{
ACE_TRACE ("ACE_Task_Base::wait");
@@ -138,7 +139,7 @@ ACE_Task_Base::wait (void)
}
// Suspend a task.
-int
+int
ACE_Task_Base::suspend (void)
{
ACE_TRACE ("ACE_Task_Base::suspend");
@@ -150,7 +151,7 @@ ACE_Task_Base::suspend (void)
}
// Resume a suspended task.
-int
+int
ACE_Task_Base::resume (void)
{
ACE_TRACE ("ACE_Task_Base::resume");
@@ -162,8 +163,8 @@ ACE_Task_Base::resume (void)
}
int
-ACE_Task_Base::activate (long flags,
- int n_threads,
+ACE_Task_Base::activate (long flags,
+ int n_threads,
int force_active,
long priority,
int grp_id,
@@ -173,7 +174,7 @@ ACE_Task_Base::activate (long flags,
#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0)
ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1);
-
+
// If the task passed in is zero, we will use <this>
if (task == 0)
task = this;
@@ -186,12 +187,12 @@ ACE_Task_Base::activate (long flags,
// Use the ACE_Thread_Manager singleton if we're running as an
// active object and the caller didn't supply us with a
// Thread_Manager.
- if (this->thr_mgr_ == 0)
+ if (this->thr_mgr_ == 0)
this->thr_mgr_ = ACE_Thread_Manager::instance ();
- this->grp_id_ = this->thr_mgr_->spawn_n (n_threads,
+ this->grp_id_ = this->thr_mgr_->spawn_n (n_threads,
ACE_THR_FUNC (&ACE_Task_Base::svc_run),
- (void *) this,
+ (void *) this,
flags,
priority,
grp_id,
@@ -280,16 +281,23 @@ ACE_Task_Base::svc_run (void *args)
// Forward the call to close() so that existing applications don't
// break.
-int
+int
ACE_Task_Base::module_closed (void)
{
return this->close (1);
}
-#if defined (ACE_TEMPLATES_REQUIRE_SPECIALIZATION)
+#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
#if (defined (ACE_HAS_THREADS) && defined (ACE_HAS_THREAD_SPECIFIC_STORAGE))
template class ACE_TSS<ACE_Task_Exit>;
// This doesn't necessarily belong here, but it's a convenient place for it.
template class ACE_TSS<ACE_Dynamic>;
#endif /* ACE_HAS_THREADS && ACE_HAS_THREAD_SPECIFIC_STORAGE */
-#endif /* ACE_TEMPLATES_REQUIRE_SPECIALIZATION */
+#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
+#if (defined (ACE_HAS_THREADS) && defined (ACE_HAS_THREAD_SPECIFIC_STORAGE))
+ #pragma instantiate ACE_TSS<ACE_Task_Exit>
+ // This doesn't necessarily belong here, but it's a convenient place for it.
+ #pragma instantiate ACE_TSS<ACE_Dynamic>
+#endif /* ACE_HAS_THREADS && ACE_HAS_THREAD_SPECIFIC_STORAGE */
+#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
+