G0.3: watchdog giu 15s khi attach-in-flight (SHM flag) + RAII guard trong attach job (fix kill nham khi GUI mo)

This commit is contained in:
2026-08-15 19:00:32 +07:00
parent 2f7861820e
commit 5313d85926
6 changed files with 41 additions and 3 deletions
+9 -1
View File
@@ -59,6 +59,10 @@ pub struct SharedAudioBufferIPC {
pub midi_queue_count: u32,
pub control_queue: [ControlEventIPC; CONTROL_QUEUE_CAP],
pub control_queue_count: u32,
// G0.3: bridge sets this while an openGUI attach job is in flight.
// Append-only field — offsets of control_queue (2836) and
// control_queue_count (11156) are unchanged.
pub attach_in_flight: u32,
}
pub struct Shm {
@@ -158,6 +162,10 @@ impl Shm {
pub fn block_timestamp(&self) -> u64 {
self.ipc().block_timestamp
}
pub fn attach_in_flight(&self) -> bool {
self.ipc().attach_in_flight != 0
}
}
impl Drop for Shm {
@@ -180,6 +188,6 @@ mod tests {
// native_bridge/tests/shm_selfcheck.cpp asserts the same sizes.
assert_eq!(std::mem::size_of::<MidiEventIPC>(), 12);
assert_eq!(std::mem::size_of::<ControlEventIPC>(), 1040);
assert_eq!(std::mem::size_of::<SharedAudioBufferIPC>(), 11160);
assert_eq!(std::mem::size_of::<SharedAudioBufferIPC>(), 11164);
}
}