mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2024-11-24 12:34:31 +00:00
base: remove Windows EventExt::new_with_manual_reset()
Replace the single new_with_manual_reset() call, which passed false to create an auto-reset event, with a call to the more descriptive new_auto_reset() function. This allows the new_with_manual_reset() API to be removed. BUG=b:231344063 TEST=tools/presubmit --all Change-Id: I51d1fcbab161d10539c44689b31e2d86ad9e1527 Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3966482 Reviewed-by: Noah Gold <nkgold@google.com> Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
This commit is contained in:
parent
a364040b4b
commit
c433c9e796
2 changed files with 2 additions and 7 deletions
|
@ -50,19 +50,14 @@ pub(crate) struct PlatformEvent {
|
|||
}
|
||||
|
||||
pub trait EventExt {
|
||||
fn new_with_manual_reset(manual_reset: bool) -> Result<Event>;
|
||||
fn new_auto_reset() -> Result<Event>;
|
||||
fn open(name: &str) -> Result<Event>;
|
||||
fn create_event_with_name(name: &str) -> Result<Event>;
|
||||
}
|
||||
|
||||
impl EventExt for Event {
|
||||
fn new_with_manual_reset(manual_reset: bool) -> Result<Event> {
|
||||
PlatformEvent::new_with_manual_reset(manual_reset).map(Event)
|
||||
}
|
||||
|
||||
fn new_auto_reset() -> Result<Event> {
|
||||
Event::new_with_manual_reset(false)
|
||||
PlatformEvent::new_with_manual_reset(false).map(Event)
|
||||
}
|
||||
|
||||
fn open(name: &str) -> Result<Event> {
|
||||
|
|
|
@ -265,7 +265,7 @@ impl DeviceRenderer {
|
|||
"Audio Client Initialize() failed."
|
||||
)?;
|
||||
|
||||
let ready_to_read_event = Event::new_with_manual_reset(false).unwrap();
|
||||
let ready_to_read_event = Event::new_auto_reset().unwrap();
|
||||
// Safe because `ready_to_read_event` will be initialized and also it has the same
|
||||
// lifetime as `audio_client` because they are owned by DeviceRenderer on return
|
||||
let hr = unsafe { audio_client.SetEventHandle(ready_to_read_event.as_raw_descriptor()) };
|
||||
|
|
Loading…
Reference in a new issue