Kernel: Disable big process lock for sys$beep()

The PCSpeaker is global and not locked anyways, so there's no need for
mutual exclusion between threads in the same process.
This commit is contained in:
Idan Horowitz 2021-08-06 14:22:21 +03:00 committed by Andreas Kling
parent c3f668a758
commit da0b7d1737
Notes: sideshowbarker 2024-07-18 07:24:01 +09:00
2 changed files with 2 additions and 2 deletions

View file

@ -133,7 +133,7 @@ enum class NeedsBigProcessLock {
S(exit_thread, NeedsBigProcessLock::Yes) \
S(mknod, NeedsBigProcessLock::Yes) \
S(writev, NeedsBigProcessLock::Yes) \
S(beep, NeedsBigProcessLock::Yes) \
S(beep, NeedsBigProcessLock::No) \
S(getsockname, NeedsBigProcessLock::Yes) \
S(getpeername, NeedsBigProcessLock::Yes) \
S(socketpair, NeedsBigProcessLock::Yes) \

View file

@ -11,7 +11,7 @@ namespace Kernel {
KResultOr<FlatPtr> Process::sys$beep()
{
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this);
VERIFY_NO_PROCESS_BIG_LOCK(this);
PCSpeaker::tone_on(440);
auto result = Thread::current()->sleep(Time::from_nanoseconds(200'000'000));
PCSpeaker::tone_off();