summaryrefslogtreecommitdiff
path: root/cancel.c
diff options
context:
space:
mode:
authorrpj <rpj>1999-01-03 16:41:14 +0000
committerrpj <rpj>1999-01-03 16:41:14 +0000
commit5ab9f5892826bb1c4e45b4dcb2692d4eb2f813f1 (patch)
tree055390c239a2f7cefdde4360a5f0f0096be19930 /cancel.c
parent63d8161801576f3acd5169b472946f4a687c4728 (diff)
Mon Jan 4 11:23:40 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au>bossom-merge-99-01-04bossom-merge-98-12-08
* all: No code changes, just cleanup. - remove #if 0 /* Pre Bossom */ enclosed code. - Remove some redundant #includes. * pthread.h: Update implemented/unimplemented routines list. * Tag the bossom merge branch getting ready to merge back to main trunk.
Diffstat (limited to 'cancel.c')
-rw-r--r--cancel.c83
1 files changed, 0 insertions, 83 deletions
diff --git a/cancel.c b/cancel.c
index 9364c47..93d6e07 100644
--- a/cancel.c
+++ b/cancel.c
@@ -5,8 +5,6 @@
* POSIX thread functions related to thread cancellation.
*/
-#include <errno.h>
-
#include "pthread.h"
#include "implement.h"
@@ -242,84 +240,3 @@ pthread_cancel (pthread_t thread)
/* </JEB> */
-#if 0 /* Pre Bossom */
-
-#include <errno.h>
-
-#include "pthread.h"
-#include "implement.h"
-
-int
-pthread_setcancelstate(int state,
- int *oldstate)
-{
- pthread_t us = pthread_self();
-
- /* Validate the new cancellation state. */
- if (state != PTHREAD_CANCEL_ENABLE
- || state != PTHREAD_CANCEL_DISABLE)
- {
- return EINVAL;
- }
-
- if (oldstate != NULL)
- {
- *oldstate = us->cancelstate;
- }
-
- us->cancelstate = state;
- return 0;
-}
-
-int
-pthread_setcanceltype(int type, int *oldtype)
-{
- pthread_t us = pthread_self();
-
- /* Validate the new cancellation type. */
- if (type == PTHREAD_CANCEL_ASYNCHRONOUS ||
- type != PTHREAD_CANCEL_DEFERRED)
- {
- return EINVAL;
- }
-
- if (oldtype != NULL)
- {
- *oldtype = us->canceltype;
- }
-
- us->canceltype = type;
- return 0;
-}
-
-int
-pthread_cancel(pthread_t thread)
-{
- if (_PTHREAD_VALID(thread)
- && thread->ptstatus != _PTHREAD_REUSE)
- {
- thread->cancel_pending = TRUE;
- return 0;
- }
-
- return ESRCH;
-}
-
-void
-pthread_testcancel(void)
-{
- pthread_t thread = pthread_self();
-
- if (thread->cancelstate == PTHREAD_CANCEL_DISABLE)
- {
- return;
- }
-
- if (thread->cancel_pending == TRUE)
- {
- pthread_exit(PTHREAD_CANCELED);
- }
- /* Never reached. */
-}
-
-#endif /* Pre Bossom */