summaryrefslogtreecommitdiff
path: root/pthread_cancel.c
diff options
context:
space:
mode:
authorrpj <rpj>2003-08-14 08:53:17 +0000
committerrpj <rpj>2003-08-14 08:53:17 +0000
commita50745ec922a917513029f3f87bf820827b43f29 (patch)
tree1e221862e0550d163baef12d17634430ae677824 /pthread_cancel.c
parent414f4bd7e70d94025576d9264c86da63c506f6ca (diff)
Reuse of thread IDs, improved thread ID validation, new tests, bug fixes.
Diffstat (limited to 'pthread_cancel.c')
-rw-r--r--pthread_cancel.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/pthread_cancel.c b/pthread_cancel.c
index 7a94d8d..a9a9009 100644
--- a/pthread_cancel.c
+++ b/pthread_cancel.c
@@ -94,12 +94,13 @@ pthread_cancel (pthread_t thread)
int cancel_self;
pthread_t self;
- if (thread == NULL )
+ /* This is the proper way to test thread validity. */
+ result = pthread_kill(thread, 0);
+ if (0 != result)
{
- return ESRCH;
+ return result;
}
- result = 0;
if ((self = pthread_self()) == NULL)
{
return ENOMEM;