fix: input_thread_proc shouldn't own the shmem

This commit is contained in:
beerpsi 2024-03-23 11:11:36 +07:00
parent 0115888309
commit 9c89301486
4 changed files with 7 additions and 7 deletions

4
Cargo.lock generated
View File

@ -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",

View File

@ -1,6 +1,6 @@
[package]
name = "aimeio-yubideck"
version = "0.1.3"
version = "0.1.4"
edition = "2021"
[lib]

View File

@ -1,6 +1,6 @@
[package]
name = "chuniio-yubideck"
version = "0.1.3"
version = "0.1.4"
edition = "2021"
[lib]

View File

@ -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:#?}");