diff options
author | nanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-03-21 18:23:47 +0000 |
---|---|---|
committer | nanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-03-21 18:23:47 +0000 |
commit | f5624533200bd3cb9a9e52c1c345bbd662826a98 (patch) | |
tree | 36177b3d87e1e7a8395e77fed3ee4da0fbb479d1 /examples | |
parent | 2c2e2e2c6673f1ef6dc96e5fdd27ef7c940cc55a (diff) | |
download | ATCD-f5624533200bd3cb9a9e52c1c345bbd662826a98.tar.gz |
Manipulate thread stack size on non-windows platforms.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/Threads/task_five.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/examples/Threads/task_five.cpp b/examples/Threads/task_five.cpp index ffafa101afb..e4977fe9e70 100644 --- a/examples/Threads/task_five.cpp +++ b/examples/Threads/task_five.cpp @@ -1,7 +1,7 @@ // $Id$ // Stress testing thread creation and thread cancellation using -// ACE_Task. +// ACE_Task. // // Author: Detlef Becker <Detlef.Becker@med.siemens.de> @@ -10,6 +10,12 @@ #include "ace/Task.h" static const int DEFAULT_TASKS = 1000; +static size_t stack_size = // Default stack size +#if defined (ACE_WIN32) + 0; +#else + 8192; +#endif class Test_Task : public ACE_Task<ACE_MT_SYNCH> { @@ -32,7 +38,15 @@ Test_Task::Test_Task (ACE_Thread_Manager *thrmgr) int Test_Task::open (void *) { - return this->activate (); + return this->activate (0, + 1, + 0, + ACE_DEFAULT_THREAD_PRIORITY, + -1, + 0, + 0, + 0, + &stack_size); } int @@ -67,7 +81,8 @@ Test_Task::synch (void) int main (int argc, char *argv[]) { - const int n_tasks = argc > 1 ? ACE_OS::atoi (argv[1]) : DEFAULT_TASKS; + size_t stack_size = argc > 1 ? ACE_OS::atoi (argv[1]) : stack_size; + const int n_tasks = argc > 2 ? ACE_OS::atoi (argv[2]) : DEFAULT_TASKS; u_int loop_count = 0; u_int error_count = 0; |