summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/os/lwp.c
diff options
context:
space:
mode:
authorraf <none@none>2005-11-09 18:29:14 -0800
committerraf <none@none>2005-11-09 18:29:14 -0800
commit8132eb48c67217d7d49a4f318ac4ff4f613d6110 (patch)
tree1499925ad1faa8eb324dcea7bfb7550ac58c906e /usr/src/uts/common/os/lwp.c
parent4f75c27e43a3c25dcbebc6889ae73f1b2c32e537 (diff)
downloadillumos-joyent-8132eb48c67217d7d49a4f318ac4ff4f613d6110.tar.gz
6339942 popen(3C) still isn't MT-safe
Diffstat (limited to 'usr/src/uts/common/os/lwp.c')
-rw-r--r--usr/src/uts/common/os/lwp.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/usr/src/uts/common/os/lwp.c b/usr/src/uts/common/os/lwp.c
index be98a8e7a4..df3f6767e8 100644
--- a/usr/src/uts/common/os/lwp.c
+++ b/usr/src/uts/common/os/lwp.c
@@ -875,6 +875,7 @@ lwp_suspend(kthread_t *t)
* Set the thread's TP_HOLDLWP flag so it will stop in holdlwp().
* If an lwp is stopping itself, there is no need to wait.
*/
+top:
t->t_proc_flag |= TP_HOLDLWP;
if (t == curthread) {
t->t_sig_check = 1;
@@ -930,13 +931,13 @@ lwp_suspend(kthread_t *t)
thread_lock(t);
/*
- * If TP_HOLDLWP flag goes away, lwp_continue() must
- * have been called while we were waiting, so cancel
- * the suspend.
+ * If the TP_HOLDLWP flag went away, lwp_continue()
+ * or vfork() must have been called while we were
+ * waiting, so start over again.
*/
if ((t->t_proc_flag & TP_HOLDLWP) == 0) {
thread_unlock(t);
- return (0);
+ goto top;
}
}
thread_unlock(t);