-
Get rid of Console::get_mut(). Use interior mutability on specific fields. Maybe with ArkRefCell that's only panicking in debug builds.
-
Some of the channels consumed by the readconsole event loop shouldn't be clonable. ReadConsole is reentrant, and cloning a receiver means only one of the clones gets a message. We currently clone them, but luckily the reentrant path shuts down the event loop beforehand. We should make an unclonable wrapper to enforce the property.
|
// Cloning is necessary to avoid a double mutable borrow error |
|
let r_request_rx = self.r_request_rx.clone(); |
|
let stdin_reply_rx = self.stdin_reply_rx.clone(); |
|
let kernel_request_rx = self.kernel_request_rx.clone(); |
|
let tasks_interrupt_rx = self.tasks_interrupt_rx.clone(); |
|
let tasks_idle_rx = self.tasks_idle_rx.clone(); |
|
let tasks_idle_any_rx = self.tasks_idle_any_rx.clone(); |
Not urgent (Ark is not exploding left and right) but would be nice to converge towards a safer setup.
Get rid of
Console::get_mut(). Use interior mutability on specific fields. Maybe withArkRefCellthat's only panicking in debug builds.Some of the channels consumed by the readconsole event loop shouldn't be clonable. ReadConsole is reentrant, and cloning a receiver means only one of the clones gets a message. We currently clone them, but luckily the reentrant path shuts down the event loop beforehand. We should make an unclonable wrapper to enforce the property.
ark/crates/ark/src/console/console_repl.rs
Lines 963 to 969 in 74efb52
Not urgent (Ark is not exploding left and right) but would be nice to converge towards a safer setup.