(self)
| 200 | |
| 201 | impl WorkerThread { |
| 202 | fn run(self) { |
| 203 | debug!("Cache worker thread started."); |
| 204 | |
| 205 | Self::lower_thread_priority(); |
| 206 | |
| 207 | #[cfg(test)] |
| 208 | let (stats, condvar) = &*self.stats; |
| 209 | |
| 210 | for event in self.receiver.iter() { |
| 211 | match event { |
| 212 | CacheEvent::OnCacheGet(path) => self.handle_on_cache_get(path), |
| 213 | CacheEvent::OnCacheUpdate(path) => self.handle_on_cache_update(path), |
| 214 | } |
| 215 | |
| 216 | #[cfg(test)] |
| 217 | { |
| 218 | let mut stats = stats.lock().expect("Failed to acquire worker stats lock"); |
| 219 | stats.handled += 1; |
| 220 | condvar.notify_all(); |
| 221 | } |
| 222 | } |
| 223 | } |
| 224 | |
| 225 | #[cfg(target_os = "fuchsia")] |
| 226 | fn lower_thread_priority() { |
no test coverage detected