Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F136752718
D9530.id24983.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D9530.id24983.diff
View Options
Index: sys/kern/kern_thread.c
===================================================================
--- sys/kern/kern_thread.c
+++ sys/kern/kern_thread.c
@@ -865,7 +865,7 @@
*
* Such locations include userret().
* If the "return_instead" argument is non zero, the thread must be able to
- * accept 0 (caller may continue), or 1 (caller must abort) as a result.
+ * accept 0 (caller may continue), or non-zero (caller must abort) as a result.
*
* The 'return_instead' argument tells the function if it may do a
* thread_exit() or suspend, or whether the caller must abort and back
@@ -877,11 +877,11 @@
*
* P_SINGLE_EXIT | return_instead == 0| return_instead != 0
*---------------+--------------------+---------------------
- * 0 | returns 0 | returns 0 or 1
+ * 0 | returns 0 | returns
* | when ST ends | immediately
*---------------+--------------------+---------------------
- * 1 | thread exits | returns 1
- * | | immediately
+ * 1 | thread exits | returns
+ * | | immediately
* 0 = thread_exit() or suspension ok,
* other = return error instead of stopping the thread.
*
@@ -915,14 +915,6 @@
if (p->p_singlethread == td)
return (0); /* Exempt from stopping. */
}
- if ((p->p_flag & P_SINGLE_EXIT) && return_instead)
- return (EINTR);
-
- /* Should we goto user boundary if we didn't come from there? */
- if (P_SHOULDSTOP(p) == P_STOPPED_SINGLE &&
- (p->p_flag & P_SINGLE_BOUNDARY) && return_instead)
- return (ERESTART);
-
/*
* Ignore suspend requests if they are deferred.
*/
@@ -935,6 +927,9 @@
return (TD_SBDRY_INTR(td) ? TD_SBDRY_ERRNO(td) : 0);
}
+ if (return_instead)
+ return (ERESTART);
+
/*
* If the process is waiting for us to exit,
* this thread should just suicide.
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 20, 6:56 AM (9 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25713116
Default Alt Text
D9530.id24983.diff (1 KB)
Attached To
Mode
D9530: thread_suspend_check: don't sleep if return_instead is 1
Attached
Detach File
Event Timeline
Log In to Comment