[rtems-libbsd commit] SLEEPQUEUE(9): Avoid Giant lock
Sebastian Huber
sebh at rtems.org
Wed May 20 07:58:40 UTC 2015
Module: rtems-libbsd
Branch: master
Commit: c2f23920283dd57acf375d5b5ff2fd5bbf9f5e2d
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=c2f23920283dd57acf375d5b5ff2fd5bbf9f5e2d
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Thu Apr 23 15:42:58 2015 +0200
SLEEPQUEUE(9): Avoid Giant lock
---
freebsd/sys/kern/subr_sleepqueue.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/freebsd/sys/kern/subr_sleepqueue.c b/freebsd/sys/kern/subr_sleepqueue.c
index 8376c47..1af1c82 100644
--- a/freebsd/sys/kern/subr_sleepqueue.c
+++ b/freebsd/sys/kern/subr_sleepqueue.c
@@ -638,9 +638,7 @@ sleepq_switch(void *wchan, int pri)
cpu_self = _Thread_Dispatch_disable_critical();
_Thread_Lock_release_default(executing, &lock_context);
- _Giant_Acquire(cpu_self);
_Thread_Set_state(executing, STATES_WAITING_FOR_BSD_WAKEUP);
- _Giant_Release(cpu_self);
_Thread_Lock_acquire_default(executing, &lock_context);
@@ -666,10 +664,8 @@ sleepq_switch(void *wchan, int pri)
_Thread_Lock_release_default(executing, &lock_context);
if (unblock) {
- _Giant_Acquire(cpu_self);
_Watchdog_Remove(&executing->Timer);
_Thread_Clear_state(executing, STATES_WAITING_FOR_BSD_WAKEUP);
- _Giant_Release(cpu_self);
}
_Thread_Dispatch_enable(cpu_self);
@@ -971,12 +967,10 @@ sleepq_resume_thread(struct sleepqueue *sq, struct thread *td, int pri)
cpu_self = _Thread_Dispatch_disable_critical();
_Thread_Lock_release_default(thread, &lock_context);
- _Giant_Acquire(cpu_self);
_Watchdog_Remove(&thread->Timer);
_Thread_Clear_state(thread, STATES_WAITING_FOR_BSD_WAKEUP);
- _Giant_Release(cpu_self);
_Thread_Dispatch_enable(cpu_self);
} else {
_Thread_Lock_release_default(thread, &lock_context);
@@ -1201,11 +1195,9 @@ sleepq_timeout(Objects_Id id, void *arg)
cpu_self = _Thread_Dispatch_disable_critical();
_Thread_Lock_release_default(thread, &lock_context);
- _Giant_Acquire(cpu_self);
_Thread_Clear_state(thread, STATES_WAITING_FOR_BSD_WAKEUP);
- _Giant_Release(cpu_self);
_Thread_Dispatch_enable(cpu_self);
} else {
_Thread_Lock_release_default(thread, &lock_context);
More information about the vc
mailing list