Check pending unblocked signals before blocking.

This is not a perfect solution, since the kernel technically already has
all the information it needs to synchronize this between the kill()
invocation and the time WaitCondition::wait is called, but it should not
have any noticeable performance impact.
This commit is contained in:
4lDO2
2024-06-30 16:39:18 +02:00
parent e9de24c097
commit 4dba818c83
+3
View File
@@ -48,6 +48,9 @@ impl WaitCondition {
{
let mut context = context_lock.write();
if let Some((control, _, _)) = context.sigcontrol() && control.currently_pending_unblocked() != 0 {
return false;
}
id = context.id;
context.block(reason);
}