mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-12-08 21:26:17 +00:00
Small Fix to Mutex Init (#6846)
This commit is contained in:
parent
15a77b525c
commit
111a6a8ed1
@ -1,6 +1,6 @@
|
|||||||
use std::{borrow::Cow, slice};
|
use std::{borrow::Cow, slice};
|
||||||
|
|
||||||
use parking_lot::{lock_api::RawMutex, Mutex};
|
use parking_lot::Mutex;
|
||||||
use windows::Win32::{Foundation, System::Diagnostics::Debug};
|
use windows::Win32::{Foundation, System::Diagnostics::Debug};
|
||||||
|
|
||||||
// This is a mutex as opposed to an atomic as we need to completely
|
// This is a mutex as opposed to an atomic as we need to completely
|
||||||
@ -9,7 +9,7 @@ use windows::Win32::{Foundation, System::Diagnostics::Debug};
|
|||||||
//
|
//
|
||||||
// By routing all the registration through these functions we can guarantee
|
// By routing all the registration through these functions we can guarantee
|
||||||
// there is either 1 or 0 exception handlers registered, not multiple.
|
// there is either 1 or 0 exception handlers registered, not multiple.
|
||||||
static EXCEPTION_HANDLER_COUNT: Mutex<usize> = Mutex::const_new(parking_lot::RawMutex::INIT, 0);
|
static EXCEPTION_HANDLER_COUNT: Mutex<usize> = Mutex::new(0);
|
||||||
|
|
||||||
pub fn register_exception_handler() {
|
pub fn register_exception_handler() {
|
||||||
let mut count_guard = EXCEPTION_HANDLER_COUNT.lock();
|
let mut count_guard = EXCEPTION_HANDLER_COUNT.lock();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user