summaryrefslogtreecommitdiffstats
path: root/lib/libpthread/thread/thr_create.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2003-04-22 20:00:26 +0000
committerjhb <jhb@FreeBSD.org>2003-04-22 20:00:26 +0000
commit82ad2123a7b313d71d0658f06af9b38db418b946 (patch)
treee7253a8991f553e9eb629a4f9920de499543b07d /lib/libpthread/thread/thr_create.c
parent3cd76cb1f7232072da9de75f0c43d9b30c28d8d0 (diff)
downloadFreeBSD-src-82ad2123a7b313d71d0658f06af9b38db418b946.zip
FreeBSD-src-82ad2123a7b313d71d0658f06af9b38db418b946.tar.gz
- Always call faultin() in _PHOLD() if PS_INMEM is clear. This closes a
race where a thread could assume that a process was swapped in by PHOLD() when it actually wasn't fully swapped in yet. - In faultin(), always msleep() if PS_SWAPPINGIN is set instead of doing this check after bumping p_lock in the PS_INMEM == 0 case. Also, sched_lock is only needed for setting and clearning swapping PS_* flags and the swap thread inhibitor. - Don't set and clear the thread swap inhibitor in the same loops as the pmap_swapin/out_thread() since we have to do it under sched_lock. Instead, mimic the treatment of the PS_INMEM flag and use separate loops to set the inhibitors when clearing PS_INMEM and clear the inhibitors when setting PS_INMEM. - swapout() now returns with the proc lock held as it holds the lock while adjusting the swapping-related PS_* flags so that the proc lock can be used to test those flags. - Only use the proc lock to check the swapping-related PS_* flags in several places. - faultin() no longer requires sched_lock to be held by callers. - Rename PS_SWAPPING to PS_SWAPPINGOUT to be less ambiguous now that we have PS_SWAPPINGIN.
Diffstat (limited to 'lib/libpthread/thread/thr_create.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud