forked from beerpsi/chuniio-yubideck
fix: input_thread_proc shouldn't own the shmem
This commit is contained in:
parent
0115888309
commit
9c89301486
4
Cargo.lock
generated
4
Cargo.lock
generated
@ -13,7 +13,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "aimeio-yubideck"
|
||||
version = "0.1.3"
|
||||
version = "0.1.4"
|
||||
dependencies = [
|
||||
"cfg_aliases",
|
||||
"faster-hex",
|
||||
@ -89,7 +89,7 @@ checksum = "77e53693616d3075149f4ead59bdeecd204ac6b8192d8969757601b74bddf00f"
|
||||
|
||||
[[package]]
|
||||
name = "chuniio-yubideck"
|
||||
version = "0.1.3"
|
||||
version = "0.1.4"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"cfg-if 1.0.0",
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "aimeio-yubideck"
|
||||
version = "0.1.3"
|
||||
version = "0.1.4"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "chuniio-yubideck"
|
||||
version = "0.1.3"
|
||||
version = "0.1.4"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
|
@ -115,7 +115,7 @@ pub extern "C" fn chuni_io_jvs_init() -> HRESULT {
|
||||
}
|
||||
}
|
||||
|
||||
match create_shared_memory("YubideckOutput", OUTPUT_SHMEM_SIZE, true) {
|
||||
match create_shared_memory("YubideckOutput", OUTPUT_SHMEM_SIZE, false) {
|
||||
Ok(s) => unsafe { OUTPUT_SHMEM = Some(Rc::new(Mutex::new(s))) },
|
||||
Err(e) => {
|
||||
error!("Could not obtain shared memory for YubiDeck output: {e:#?}");
|
||||
@ -395,7 +395,7 @@ fn input_thread_proc() {
|
||||
let device_rg = DEVICE.read().unwrap();
|
||||
let Some(device) = device_rg.as_ref().map(|z| z) else { return };
|
||||
|
||||
let mut input_shmem = match create_shared_memory("YubideckInput", INPUT_SHMEM_SIZE, true) {
|
||||
let mut input_shmem = match create_shared_memory("YubideckInput", INPUT_SHMEM_SIZE, false) {
|
||||
Ok(s) => s,
|
||||
Err(e) => {
|
||||
error!("Could not obtain shared memory for YubiDeck input: {e:#}");
|
||||
@ -404,7 +404,7 @@ fn input_thread_proc() {
|
||||
};
|
||||
let usb_in = unsafe { input_shmem.as_slice_mut() };
|
||||
|
||||
let mut output_shmem = match create_shared_memory("YubideckOutput", OUTPUT_SHMEM_SIZE, true) {
|
||||
let mut output_shmem = match create_shared_memory("YubideckOutput", OUTPUT_SHMEM_SIZE, false) {
|
||||
Ok(s) => s,
|
||||
Err(e) => {
|
||||
error!("Could not obtain shared memory for YubiDeck output: {e:#?}");
|
||||
|
Loading…
Reference in New Issue
Block a user