summaryrefslogtreecommitdiff
path: root/cancel.c
diff options
context:
space:
mode:
authorrpj <rpj>1999-03-23 19:43:43 +0000
committerrpj <rpj>1999-03-23 19:43:43 +0000
commitab9f05fd540b3eff6456f886edda87cb95bfbadc (patch)
treecce54aa13890262b6c6c8357f64479aedd902752 /cancel.c
parentaa07e974e0a6277492cc091762751ec28dfe3e96 (diff)
Wed Mar 24 11:32:07 1999 Ross Johnson <rpj@swan.canberra.edu.au>
* misc.c (CancelableWait): Initialise exceptionInformation[2]. (pthread_self): Get a real Win32 thread handle for implicit threads. * cancel.c (pthread_testcancel): Initialise exceptionInformation[2]. * implement.h (SE_INFORMATION): Fix values. * private.c (_pthread_threadDestroy): Close the thread handle. Fri Mar 19 12:57:27 1999 Ross Johnson <rpj@swan.canberra.edu.au> * cancel.c (comments): Update and cleanup. Fri Mar 19 09:12:59 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au> * private.c (_pthread_threadStart): status returns PTHREAD_CANCELED. * pthread.h (PTHREAD_CANCELED): defined.
Diffstat (limited to 'cancel.c')
-rw-r--r--cancel.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/cancel.c b/cancel.c
index 8b93705..dac8e66 100644
--- a/cancel.c
+++ b/cancel.c
@@ -26,10 +26,6 @@
#include "pthread.h"
#include "implement.h"
-/*
- * Code contributed by John E. Bossom <JEB>.
- */
-
int
pthread_setcancelstate (int state, int *oldstate)
/*
@@ -106,7 +102,7 @@ pthread_setcanceltype (int type, int *oldtype)
* PTHREAD_CANCEL_DEFERRED
* only deferred cancelation is allowed,
*
- * PTHRAD_CANCEL_ASYNCHRONOUS
+ * PTHREAD_CANCEL_ASYNCHRONOUS
* Asynchronous cancellation is allowed
*
*
@@ -201,6 +197,7 @@ pthread_testcancel (void)
exceptionInformation[0] = (DWORD) (0);
exceptionInformation[1] = (DWORD) (0);
+ exceptionInformation[2] = (DWORD) (0);
RaiseException (
EXCEPTION_PTHREAD_SERVICES,
@@ -242,7 +239,7 @@ pthread_cancel (pthread_t thread)
* wait for termination of 'thread' if necessary.
*
* RESULTS
- * 0 successfully created semaphore,
+ * 0 successfully requested cancellation,
* ESRCH no thread found corresponding to 'thread',
*
* ------------------------------------------------------
@@ -252,7 +249,9 @@ pthread_cancel (pthread_t thread)
if (thread != NULL)
{
-
+ /*
+ * Set for deferred cancellation.
+ */
if (!SetEvent (thread->cancelEvent))
{
result = ESRCH;
@@ -271,5 +270,3 @@ pthread_cancel (pthread_t thread)
return (result);
}
-/* </JEB> */
-