mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-17 02:26:46 +00:00
Drop the MutexGuard
of semaphore earlier
This commit is contained in:
parent
547e6430ee
commit
ccdf2dc54f
@ -198,6 +198,7 @@ impl Semaphore {
|
|||||||
} else if zero_condition {
|
} else if zero_condition {
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
drop(val);
|
||||||
|
|
||||||
// Need to wait for the semaphore
|
// Need to wait for the semaphore
|
||||||
if flags.contains(IpcFlags::IPC_NOWAIT) {
|
if flags.contains(IpcFlags::IPC_NOWAIT) {
|
||||||
@ -219,7 +220,6 @@ impl Semaphore {
|
|||||||
} else {
|
} else {
|
||||||
self.pending_alters.lock().push_back(pending_op);
|
self.pending_alters.lock().push_back(pending_op);
|
||||||
}
|
}
|
||||||
drop(val);
|
|
||||||
|
|
||||||
// Wait
|
// Wait
|
||||||
if let Some(timeout) = timeout {
|
if let Some(timeout) = timeout {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user