Get the MISSING sentinel, creating it if necessary.
(vm: &VirtualMachine)
| 142 | |
| 143 | /// Get the MISSING sentinel, creating it if necessary. |
| 144 | pub fn get_missing(vm: &VirtualMachine) -> PyObjectRef { |
| 145 | let mut state = vm.state.monitoring.lock(); |
| 146 | if let Some(ref m) = state.missing { |
| 147 | m.clone() |
| 148 | } else { |
| 149 | let m: PyObjectRef = sys_monitoring::MonitoringSentinel.into_ref(&vm.ctx).into(); |
| 150 | state.missing = Some(m.clone()); |
| 151 | m |
| 152 | } |
| 153 | } |
| 154 | |
| 155 | /// Get the DISABLE sentinel, creating it if necessary. |
| 156 | pub fn get_disable(vm: &VirtualMachine) -> PyObjectRef { |
no test coverage detected