summaryrefslogtreecommitdiff
path: root/Kernel/Syscalls/alarm.cpp
diff options
context:
space:
mode:
authorBrian Gianforcaro <bgianf@serenityos.org>2021-07-19 10:32:55 -0700
committerGunnar Beutner <gunnar@beutner.name>2021-07-20 03:21:14 +0200
commitbb1fa019de43de8a03e5c0c9ed79fc043ae5163f (patch)
treeaef0b6399a861c55418e4cf44bebe4316023ad73 /Kernel/Syscalls/alarm.cpp
parent354e18a5a0267d956de775c7493b28469e3c11c0 (diff)
downloadserenity-bb1fa019de43de8a03e5c0c9ed79fc043ae5163f.zip
Kernel: Allow MutexLocker to be conditionally initialized
There are cases where we want to conditionally take a lock, but still would like to use an RAII type to make sure we don't leak the lock. This was previously impossible to do with `MutexLocker` due to it's design. This commit tweaks the design to allow the object to be initialized to an "empty" state without a lock associated, so it does nothing, and then later a lock can be "attached" to the locker. I realized that the get_lock() API's where also unused, and would no longer make sense for empty locks, so they were removed.
Diffstat (limited to 'Kernel/Syscalls/alarm.cpp')
0 files changed, 0 insertions, 0 deletions