agb 0.23.1

Library for Game Boy Advance Development
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use core::cell::UnsafeCell;

#[derive(Default)]
pub struct SyncUnsafeCell<T>(UnsafeCell<T>);

unsafe impl<T> Sync for SyncUnsafeCell<T> {}
unsafe impl<T> Send for SyncUnsafeCell<T> {}

impl<T> SyncUnsafeCell<T> {
    pub const fn new(t: T) -> Self {
        Self(UnsafeCell::new(t))
    }

    pub unsafe fn get(&self) -> *mut T {
        self.0.get()
    }
}