struct Test {
a: UnsafeCell<Vec<i32>>,
b: UnsafeCell<Vec<i32>>
}

// 手動でスレッドセーフであることを宣言
unsafe impl Sync for Test {}

impl Test {
fn new() -> Self {
Test {
a: UnsafeCell::new(Vec::new()),
b: UnsafeCell::new(Vec::new())
}
}
fn get_a(&self) -> &mut Vec<i32> {
unsafe { &mut *self.a.get() }
}
fn get_b(&self) -> &mut Vec<i32> {
unsafe { &mut *self.b.get() }
}
}