summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/libkse/thread/thr_kern.c10
-rw-r--r--lib/libpthread/thread/thr_kern.c10
2 files changed, 14 insertions, 6 deletions
diff --git a/lib/libkse/thread/thr_kern.c b/lib/libkse/thread/thr_kern.c
index ddcae89efbe4..e29f98570570 100644
--- a/lib/libkse/thread/thr_kern.c
+++ b/lib/libkse/thread/thr_kern.c
@@ -2539,7 +2539,11 @@ _thr_debug_check_yield(struct pthread *curthread)
* is cleared by debugger, the flag will be cleared in next
* suspension event.
*/
- if ((curthread->attr.flags & PTHREAD_SCOPE_SYSTEM) == 0 &&
- !DBG_CAN_RUN(curthread))
- _thr_sched_switch(curthread);
+ if (!DBG_CAN_RUN(curthread)) {
+ if ((curthread->attr.flags & PTHREAD_SCOPE_SYSTEM) == 0)
+ _thr_sched_switch(curthread);
+ else
+ kse_thr_interrupt(&curthread->tcb->tcb_tmbx,
+ KSE_INTR_DBSUSPEND, 0);
+ }
}
diff --git a/lib/libpthread/thread/thr_kern.c b/lib/libpthread/thread/thr_kern.c
index ddcae89efbe4..e29f98570570 100644
--- a/lib/libpthread/thread/thr_kern.c
+++ b/lib/libpthread/thread/thr_kern.c
@@ -2539,7 +2539,11 @@ _thr_debug_check_yield(struct pthread *curthread)
* is cleared by debugger, the flag will be cleared in next
* suspension event.
*/
- if ((curthread->attr.flags & PTHREAD_SCOPE_SYSTEM) == 0 &&
- !DBG_CAN_RUN(curthread))
- _thr_sched_switch(curthread);
+ if (!DBG_CAN_RUN(curthread)) {
+ if ((curthread->attr.flags & PTHREAD_SCOPE_SYSTEM) == 0)
+ _thr_sched_switch(curthread);
+ else
+ kse_thr_interrupt(&curthread->tcb->tcb_tmbx,
+ KSE_INTR_DBSUSPEND, 0);
+ }
}