make ArenaBuffer unsafe Send + Sync

This commit is contained in:
Nikita Sivukhin
2025-11-11 18:17:04 +04:00
parent 33375697d1
commit d519945098
7 changed files with 15 additions and 10 deletions

View File

@@ -242,7 +242,7 @@ impl ProtocolIO for JsProtocolIo {
}))
}
fn add_work(&self, callback: Box<dyn FnMut() -> bool + Send + Sync>) {
fn add_work(&self, callback: Box<dyn FnMut() -> bool + Send>) {
let mut work = self.work.lock().unwrap();
work.push_back(callback);
}
@@ -270,7 +270,7 @@ impl ProtocolIO for JsProtocolIo {
#[napi]
pub struct JsProtocolIo {
requests: Mutex<Vec<JsProtocolRequestBytes>>,
work: Mutex<VecDeque<Box<dyn FnMut() -> bool + Send + Sync>>>,
work: Mutex<VecDeque<Box<dyn FnMut() -> bool + Send>>>,
}
impl Default for JsProtocolIo {

View File

@@ -307,7 +307,8 @@ impl SyncEngine {
#[napi]
pub fn protocol_io_step(&self) -> napi::Result<()> {
Ok(self.protocol()?.step_work())
self.protocol()?.step_work();
Ok(())
}
#[napi]