thr_private.h (118510) | thr_private.h (119063) |
---|---|
1/* 2 * Copyright (c) 1995-1998 John Birrell <jb@cimlogic.com.au>. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * 32 * Private thread definitions for the uthread kernel. 33 * | 1/* 2 * Copyright (c) 1995-1998 John Birrell <jb@cimlogic.com.au>. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * 32 * Private thread definitions for the uthread kernel. 33 * |
34 * $FreeBSD: head/lib/libkse/thread/thr_private.h 118510 2003-08-05 22:46:00Z deischen $ | 34 * $FreeBSD: head/lib/libkse/thread/thr_private.h 119063 2003-08-18 03:58:29Z davidxu $ |
35 */ 36 37#ifndef _THR_PRIVATE_H 38#define _THR_PRIVATE_H 39 40/* 41 * Include files. 42 */ --- 140 unchanged lines hidden (view full) --- 183 TAILQ_ENTRY(kse) k_kgqe; /* KSEG's KSE list entry */ 184 /* 185 * Items that are only modified by the kse, or that otherwise 186 * don't need to be locked when accessed 187 */ 188 struct lock k_lock; 189 struct lockuser k_lockusers[MAX_KSE_LOCKLEVEL]; 190 int k_locklevel; | 35 */ 36 37#ifndef _THR_PRIVATE_H 38#define _THR_PRIVATE_H 39 40/* 41 * Include files. 42 */ --- 140 unchanged lines hidden (view full) --- 183 TAILQ_ENTRY(kse) k_kgqe; /* KSEG's KSE list entry */ 184 /* 185 * Items that are only modified by the kse, or that otherwise 186 * don't need to be locked when accessed 187 */ 188 struct lock k_lock; 189 struct lockuser k_lockusers[MAX_KSE_LOCKLEVEL]; 190 int k_locklevel; |
191 sigset_t k_sigmask; 192 struct sigstatus k_sigq[_SIG_MAXSIG]; | |
193 stack_t k_stack; | 191 stack_t k_stack; |
194 int k_check_sigq; | |
195 int k_flags; 196#define KF_STARTED 0x0001 /* kernel kse created */ 197#define KF_INITIALIZED 0x0002 /* initialized on 1st upcall */ | 192 int k_flags; 193#define KF_STARTED 0x0001 /* kernel kse created */ 194#define KF_INITIALIZED 0x0002 /* initialized on 1st upcall */ |
198 int k_waiting; | |
199 int k_idle; /* kse is idle */ 200 int k_error; /* syscall errno in critical */ 201 int k_cpu; /* CPU ID when bound */ 202 int k_done; /* this KSE is done */ 203 int k_switch; /* thread switch in UTS */ 204 int k_sigseqno; /* signal buffered count */ 205}; 206 --- 82 unchanged lines hidden (view full) --- 289 if (((thrd)->flags & THR_FLAGS_IN_WAITQ) != 0) { \ 290 TAILQ_REMOVE(&(kse)->k_schedq->sq_waitq, thrd, pqe); \ 291 (thrd)->flags &= ~THR_FLAGS_IN_WAITQ; \ 292 } \ 293} while (0) 294#define KSE_WAITQ_INSERT(kse, thrd) kse_waitq_insert(thrd) 295#define KSE_WAITQ_FIRST(kse) TAILQ_FIRST(&(kse)->k_schedq->sq_waitq) 296 | 195 int k_idle; /* kse is idle */ 196 int k_error; /* syscall errno in critical */ 197 int k_cpu; /* CPU ID when bound */ 198 int k_done; /* this KSE is done */ 199 int k_switch; /* thread switch in UTS */ 200 int k_sigseqno; /* signal buffered count */ 201}; 202 --- 82 unchanged lines hidden (view full) --- 285 if (((thrd)->flags & THR_FLAGS_IN_WAITQ) != 0) { \ 286 TAILQ_REMOVE(&(kse)->k_schedq->sq_waitq, thrd, pqe); \ 287 (thrd)->flags &= ~THR_FLAGS_IN_WAITQ; \ 288 } \ 289} while (0) 290#define KSE_WAITQ_INSERT(kse, thrd) kse_waitq_insert(thrd) 291#define KSE_WAITQ_FIRST(kse) TAILQ_FIRST(&(kse)->k_schedq->sq_waitq) 292 |
297#define KSE_SET_WAIT(kse) atomic_store_rel_int(&(kse)->k_waiting, 1) 298 299#define KSE_CLEAR_WAIT(kse) atomic_store_rel_int(&(kse)->k_waiting, 0) 300 301#define KSE_WAITING(kse) (kse)->k_waiting != 0 | |
302#define KSE_WAKEUP(kse) kse_wakeup(&(kse)->k_kcb->kcb_kmbx) 303 304#define KSE_SET_IDLE(kse) ((kse)->k_idle = 1) 305#define KSE_CLEAR_IDLE(kse) ((kse)->k_idle = 0) 306#define KSE_IS_IDLE(kse) ((kse)->k_idle != 0) 307 308/* 309 * TailQ initialization values. --- 418 unchanged lines hidden (view full) --- 728 union pthread_wait_data data; 729 730 /* 731 * Set to TRUE if a blocking operation was 732 * interrupted by a signal: 733 */ 734 int interrupted; 735 | 293#define KSE_WAKEUP(kse) kse_wakeup(&(kse)->k_kcb->kcb_kmbx) 294 295#define KSE_SET_IDLE(kse) ((kse)->k_idle = 1) 296#define KSE_CLEAR_IDLE(kse) ((kse)->k_idle = 0) 297#define KSE_IS_IDLE(kse) ((kse)->k_idle != 0) 298 299/* 300 * TailQ initialization values. --- 418 unchanged lines hidden (view full) --- 719 union pthread_wait_data data; 720 721 /* 722 * Set to TRUE if a blocking operation was 723 * interrupted by a signal: 724 */ 725 int interrupted; 726 |
736 /* Signal number when in state PS_SIGWAIT: */ 737 int signo; 738 | |
739 /* 740 * Set to non-zero when this thread has entered a critical 741 * region. We allow for recursive entries into critical regions. 742 */ 743 int critical_count; 744 745 /* 746 * Set to TRUE if this thread should yield after leaving a --- 493 unchanged lines hidden --- | 727 /* 728 * Set to non-zero when this thread has entered a critical 729 * region. We allow for recursive entries into critical regions. 730 */ 731 int critical_count; 732 733 /* 734 * Set to TRUE if this thread should yield after leaving a --- 493 unchanged lines hidden --- |