equal
deleted
inserted
replaced
31 pub struct PySharedState { |
31 pub struct PySharedState { |
32 leak_count: Cell<usize>, |
32 leak_count: Cell<usize>, |
33 mutably_borrowed: Cell<bool>, |
33 mutably_borrowed: Cell<bool>, |
34 } |
34 } |
35 |
35 |
|
36 // &PySharedState can be Send because any access to inner cells is |
|
37 // synchronized by the GIL. |
|
38 unsafe impl Sync for PySharedState {} |
|
39 |
36 impl PySharedState { |
40 impl PySharedState { |
37 pub fn borrow_mut<'a, T>( |
41 pub fn borrow_mut<'a, T>( |
38 &'a self, |
42 &'a self, |
39 py: Python<'a>, |
43 py: Python<'a>, |
40 pyrefmut: RefMut<'a, T>, |
44 pyrefmut: RefMut<'a, T>, |