diff options
author | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-01-24 04:06:24 +0000 |
---|---|---|
committer | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-01-24 04:06:24 +0000 |
commit | f29291773da8cc58d8f6fa6f1d44f97bc58edc12 (patch) | |
tree | 4f74c19c16d4ea7edd2afbdbb70706819846af2a | |
parent | 57d16e0e25500c2d00293817d3e2b9e16c6fa195 (diff) | |
download | ATCD-f29291773da8cc58d8f6fa6f1d44f97bc58edc12.tar.gz |
(kill_thr): On VxWorks, use strncmp instead of strcmp to check for allocated thread ID
-rw-r--r-- | ace/Thread_Manager.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/ace/Thread_Manager.cpp b/ace/Thread_Manager.cpp index 06a5c5ae0b4..d81c30aaf87 100644 --- a/ace/Thread_Manager.cpp +++ b/ace/Thread_Manager.cpp @@ -794,7 +794,7 @@ ACE_Thread_Manager::remove_thr (ACE_Thread_Descriptor *td, this->thr_list_.remove (td); #if defined (VXWORKS) - if (tid && ACE_OS::strcmp (tid, "==ace_t==") == 0) + if (tid && ACE_OS::strncmp (tid, "==ace_t==", 9) == 0) { delete tid; } @@ -893,19 +893,20 @@ ACE_Thread_Manager::cancel_thr (ACE_Thread_Descriptor *td, int) } int -ACE_Thread_Manager::kill_thr (ACE_Thread_Descriptor *td, int arg) +ACE_Thread_Manager::kill_thr (ACE_Thread_Descriptor *td, int signum) { ACE_TRACE ("ACE_Thread_Manager::kill_thr"); - int signum = (int) arg; + ACE_thread_t tid = td->thr_id_; +#if defined (VXWORKS) + tid += ACE_OS::strncmp (tid, "==ace_t==", 9) == 0 ? 9 : 0; +#endif /* VXWORKS */ - int result = ACE_Thread::kill ((ACE_thread_t) td->thr_id_, - signum); + int result = ACE_Thread::kill (tid, signum); if (result != 0) { - // Only remove a thread from us when there is a - // "real" error. + // Only remove a thread from us when there is a "real" error. if (errno != ENOTSUP) this->thr_to_be_removed_.enqueue_tail (td); |