summaryrefslogtreecommitdiff
path: root/private.c
diff options
context:
space:
mode:
authorrpj <rpj>1999-03-18 16:18:39 +0000
committerrpj <rpj>1999-03-18 16:18:39 +0000
commit907de7f11ebcac02b705b421c3a4480cac9deaaf (patch)
tree5db3a96522f91a7ab9e38b10c89c370c7cb9e4b1 /private.c
parent6f37434d05b3598c132702d1a5c92a04927dfa58 (diff)
==> ChangeLog <==
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. ==> tests/ChangeLog <== Fri Mar 19 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au> * *.bat: redirect unwanted output to nul: * runall.bat: new. * cancel1.c: new. Not part of suite yet.
Diffstat (limited to 'private.c')
-rw-r--r--private.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/private.c b/private.c
index a4cdcda..9ffd1b3 100644
--- a/private.c
+++ b/private.c
@@ -147,7 +147,7 @@ _pthread_threadStart (ThreadParms * threadParms)
void *(*start) (void *);
void *arg;
- int status;
+ void * status;
tid = threadParms->tid;
start = threadParms->start;
@@ -165,7 +165,7 @@ _pthread_threadStart (ThreadParms * threadParms)
* Run the caller's routine;
*/
(*start) (arg);
- status = 0;
+ status = (void *) 0;
}
__except (EXCEPTION_EXECUTE_HANDLER)
{
@@ -173,7 +173,7 @@ _pthread_threadStart (ThreadParms * threadParms)
* A system unexpected exception had occurred running the user's
* routine. We get control back within this block.
*/
- status = -1;
+ status = PTHREAD_CANCELED;
}
#else /* _MSC_VER */
@@ -186,14 +186,14 @@ _pthread_threadStart (ThreadParms * threadParms)
* Run the caller's routine;
*/
(*start) (arg);
- status = 0;
+ status = (void *) 0;
}
catch (Pthread_exception)
{
/*
* Thread was cancelled.
*/
- status = -1;
+ status = PTHREAD_CANCELED;
}
catch (...)
{
@@ -201,24 +201,28 @@ _pthread_threadStart (ThreadParms * threadParms)
* A system unexpected exception had occurred running the user's
* routine. We get control back within this block.
*/
- status = -1;
+ status = PTHREAD_CANCELED;
}
#else /* __cplusplus */
/*
- * Run the caller's routine;
+ * Run the caller's routine; no cancelation or other exceptions will
+ * be honoured.
*/
(*start) (arg);
- status = 0;
+ status = (void *) 0;
#endif /* __cplusplus */
#endif /* _WIN32 */
- pthread_exit ((void *) status);
+ pthread_exit (status);
- return ((void *) status);
+ /*
+ * Never reached.
+ */
+ return (status);
} /* threadStart */