summaryrefslogtreecommitdiff
path: root/lib/libpthread
diff options
context:
space:
mode:
authornathanw <nathanw@NetBSD.org>2003-06-26 01:26:11 +0000
committernathanw <nathanw@NetBSD.org>2003-06-26 01:26:11 +0000
commit2534cd2beadce5ff2e129760a28671248bb60cca (patch)
tree4bc8b08b9ff2e21b277e3f819ad0144ed46e79ad /lib/libpthread
parentd1fcb86326126ecf31aaf230c1d4863b8000b22d (diff)
Introduce a new pointer, pt_trapuc, that stores thread context captured
by the kernel. Separating this from pt_uc makes it possible to avoid a race condition in pt_uc management near the STACK_SWITCH part of pthread__switch() and pthread__locked_switch(). Remove pt_sleepuc pointer, which was made obsolete by the previous round of UC juggling but still present in the assembler files.
Diffstat (limited to 'lib/libpthread')
-rw-r--r--lib/libpthread/pthread_int.h8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/libpthread/pthread_int.h b/lib/libpthread/pthread_int.h
index c48ef0b5188..9c93a5e7312 100644
--- a/lib/libpthread/pthread_int.h
+++ b/lib/libpthread/pthread_int.h
@@ -1,4 +1,4 @@
-/* $NetBSD: pthread_int.h,v 1.13 2003/06/06 21:06:07 nathanw Exp $ */
+/* $NetBSD: pthread_int.h,v 1.14 2003/06/26 01:26:11 nathanw Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -99,6 +99,7 @@ struct pthread_st {
stack_t pt_stack; /* Our stack */
ucontext_t *pt_uc; /* Saved context when we're stopped */
+ ucontext_t *pt_trapuc; /* Kernel-saved context */
sigset_t pt_sigmask; /* Signals we won't take. */
sigset_t pt_siglist; /* Signals pending for us. */
@@ -128,11 +129,6 @@ struct pthread_st {
pthread_t pt_switchto;
ucontext_t* pt_switchtouc;
- /* The context we saved in pthread__locked_switch but which
- * was trashed when we were preempted before switching stacks.
- */
- ucontext_t* pt_sleepuc;
-
/* Threads that are preempted with spinlocks held will be
* continued until they unlock their spinlock. When they do
* so, they should jump ship to the thread pointed to by