summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/kern/kern_kse.c2
-rw-r--r--sys/kern/kern_thread.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/sys/kern/kern_kse.c b/sys/kern/kern_kse.c
index 4c692e5..18b55d5 100644
--- a/sys/kern/kern_kse.c
+++ b/sys/kern/kern_kse.c
@@ -1087,7 +1087,9 @@ thread_statclock(int user)
return (-1);
if (user) {
/* Current always do via ast() */
+ mtx_lock_spin(&sched_lock);
td->td_flags |= (TDF_USTATCLOCK|TDF_ASTPENDING);
+ mtx_unlock_spin(&sched_lock);
td->td_uuticks++;
} else {
if (td->td_mailbox != NULL)
diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c
index 4c692e5..18b55d5 100644
--- a/sys/kern/kern_thread.c
+++ b/sys/kern/kern_thread.c
@@ -1087,7 +1087,9 @@ thread_statclock(int user)
return (-1);
if (user) {
/* Current always do via ast() */
+ mtx_lock_spin(&sched_lock);
td->td_flags |= (TDF_USTATCLOCK|TDF_ASTPENDING);
+ mtx_unlock_spin(&sched_lock);
td->td_uuticks++;
} else {
if (td->td_mailbox != NULL)
OpenPOWER on IntegriCloud