diff options
author | jcej <jcej@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-01-31 16:57:11 +0000 |
---|---|---|
committer | jcej <jcej@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-01-31 16:57:11 +0000 |
commit | ea604c0714a46eef1f159c31f17c3367147bcf22 (patch) | |
tree | 88c57b0e9ef579128c4e88b5bd7550a6f303bc98 /docs/tutorials/010/task.cpp | |
parent | 67f212c9a6ca8293fd03ba5f208c52679b7dc542 (diff) | |
download | ATCD-ea604c0714a46eef1f159c31f17c3367147bcf22.tar.gz |
*** empty log message ***
Diffstat (limited to 'docs/tutorials/010/task.cpp')
-rw-r--r-- | docs/tutorials/010/task.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/docs/tutorials/010/task.cpp b/docs/tutorials/010/task.cpp index 84f70cae0ee..4311474dceb 100644 --- a/docs/tutorials/010/task.cpp +++ b/docs/tutorials/010/task.cpp @@ -24,6 +24,12 @@ Task::~Task (void) Get our shutdown notification out of the queue and release it. */ ACE_Message_Block * message; + + /* + Like the getq() in svc() below, this will block until a message + arrives. By blocking, we know that the destruction will be paused + until the last thread is done with the message block. + */ this->getq(message); message->release(); @@ -35,7 +41,7 @@ Task::~Task (void) it how many threads we'll be using. Next, we activate the Task into the number of requested threads. */ -int Task::open (int threads) +int Task::start (int threads) { barrier_ = new ACE_Barrier (threads); return this->activate (THR_NEW_LWP, threads); @@ -76,7 +82,8 @@ int Task::svc (void) while (1) { /* - Get a message from the queue. + Get a message from the queue. Note that getq() will block until + a message shows up. That makes us very processor-friendly. */ if (this->getq (message) == -1) { |