Mutex-like wrapper object for data that is protected by the Python GIL. # Example ``` use std::cell::Cell; use cpython::{Python, GILProtected}; let data = GILProtected::new(Cell::new(0)); { let gil_guard = Python::acquire_gil(); let cell = data.get(gil_guard.python()); cell.set(cell.get() + 1); } ```
| 155 | /// } |
| 156 | /// ``` |
| 157 | pub struct GILProtected<T> { |
| 158 | data: T, |
| 159 | } |
| 160 | |
| 161 | unsafe impl<T: Send> Send for GILProtected<T> {} |
| 162 |
nothing calls this directly
no outgoing calls
no test coverage detected