summaryrefslogtreecommitdiff
path: root/ace/Thread_Manager.cpp
diff options
context:
space:
mode:
authornanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-06-18 21:25:03 +0000
committernanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-06-18 21:25:03 +0000
commitd766e78bd94c279a74e26a6eb1ebcb42dcf323f0 (patch)
treeadbd72d611adc204a18d7f08dfdcb062743c8ecf /ace/Thread_Manager.cpp
parent1b6c094c78f84fba1d1de4cfea96c6a02e49052b (diff)
downloadATCD-d766e78bd94c279a74e26a6eb1ebcb42dcf323f0.tar.gz
In macro ACE_EXECUTE_OP and method kill, we need to guard against non-existing target.
Diffstat (limited to 'ace/Thread_Manager.cpp')
-rw-r--r--ace/Thread_Manager.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/ace/Thread_Manager.cpp b/ace/Thread_Manager.cpp
index 4d2571b4c62..1809f9c847f 100644
--- a/ace/Thread_Manager.cpp
+++ b/ace/Thread_Manager.cpp
@@ -966,6 +966,11 @@ ACE_Thread_Manager::kill_thr (ACE_Thread_Descriptor *td, int signum)
ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1)); \
ACE_ASSERT (this->thr_to_be_removed_.is_empty ()); \
ACE_FIND (this->find_thread (t_id), ptr); \
+ if (ptr == 0) \
+ { \
+ errno = ENOENT; \
+ return -1; \
+ } \
int result = OP (ptr); \
int error = errno; \
while (! this->thr_to_be_removed_.is_empty ()) { \
@@ -1013,6 +1018,12 @@ ACE_Thread_Manager::kill (ACE_thread_t t_id, int signum)
ACE_ASSERT (this->thr_to_be_removed_.is_empty ());
ACE_FIND (this->find_thread (t_id), ptr);
+ if (ptr == 0)
+ {
+ errno = ENOENT;
+ return -1 ;
+ }
+
int result = this->kill_thr (ptr, signum);
int error = errno;
while (! this->thr_to_be_removed_.is_empty ()) {