()
| 112 | |
| 113 | #[test] |
| 114 | fn borrows_span_threads() { |
| 115 | Python::attach(|py| { |
| 116 | let array = PyArray::<f64, _>::zeros(py, (1, 2, 3), false); |
| 117 | |
| 118 | let _exclusive = array.readwrite(); |
| 119 | |
| 120 | let array = array.unbind(); |
| 121 | |
| 122 | py.detach(move || { |
| 123 | let thread = spawn(move || { |
| 124 | Python::attach(|py| { |
| 125 | let array = array.bind(py); |
| 126 | |
| 127 | let _exclusive = array.readwrite(); |
| 128 | }); |
| 129 | }); |
| 130 | |
| 131 | assert!(thread.join().is_err()); |
| 132 | }); |
| 133 | }); |
| 134 | } |
| 135 | |
| 136 | #[test] |
| 137 | fn shared_borrows_can_be_cloned() { |