MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / run

Method run

crates/cache/src/worker.rs:202–223  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

200
201impl 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() {

Callers 2

start_newMethod · 0.45

Calls 5

handle_on_cache_getMethod · 0.80
iterMethod · 0.45
expectMethod · 0.45
lockMethod · 0.45

Tested by

no test coverage detected