use a read guard instead of write

This commit is contained in:
teoxoy authored and Teodor Tanasoaia committed 2024-07-03 15:01:41 +02:00
1 parent eb0eb342cf
commit ef7d27233e
1 file changed
+3 -6
+3 -6
View File
@@ -259,12 +259,9 @@ impl Global {
) -> Result<(), WaitIdleError> {
let hub = A::hub(self);
let last_submission = {
let buffer_guard = hub.buffers.write();
match buffer_guard.get(buffer_id) {
Ok(buffer) => buffer.submission_index(),
Err(_) => return Ok(()),
}
let last_submission = match hub.buffers.read().get(buffer_id) {
Ok(buffer) => buffer.submission_index(),
Err(_) => return Ok(()),
};
hub.devices