{"record":{"id":"74f1abdc3b9a60db","repo":"emilk/egui","slug":"failed-to-spawn-thread-74f1ab","errorCode":null,"errorMessage":"failed to spawn thread","messagePattern":"failed to spawn thread","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/egui_extras/src/loaders/image_loader.rs","lineNumber":132,"sourceCode":"                                true\n                            } else {\n                                log::trace!(\"ImageLoader - canceled loading {uri:?}\\nNote: This can happen if `forget_image` is called while the image is still loading.\");\n                                false\n                            }\n                        };\n                        // We may not lock Context while the cache lock is held, since this can\n                        // deadlock.\n                        // Example deadlock scenario:\n                        // - loader thread: lock cache\n                        // - main thread: lock ctx (e.g. in `Context::has_pending_images`)\n                        // - loader thread: try to lock ctx (in `request_repaint`)\n                        // - main thread: try to lock cache (from `Self::has_pending`)\n                        if repaint {\n                            ctx.request_repaint();\n                        }\n                    }\n                })\n                .expect(\"failed to spawn thread\");\n\n            Ok(ImagePoll::Pending { size: None })\n        }\n\n        #[cfg(target_arch = \"wasm32\")]\n        fn load_image(\n            _ctx: &egui::Context,\n            uri: &str,\n            cache: &Arc<Mutex<HashMap<String, Entry>>>,\n            bytes: &Bytes,\n        ) -> ImageLoadResult {\n            let mut cache_lock = cache.lock();\n            log::trace!(\"started loading {uri:?}\");\n            let result = crate::image::load_image_bytes(bytes)\n                .map(Arc::new)\n                .map_err(|err| err.to_string());\n            log::trace!(\"finished loading {uri:?}\");\n            cache_lock.insert(uri.into(), core::task::Poll::Ready(result.clone()));","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/emilk/egui/blob/d802a982ce959839d92f4f6718fdffa41143110e/crates/egui_extras/src/loaders/image_loader.rs#L114-L150","documentation":"Error \"failed to spawn thread\" thrown in emilk/egui.","triggerScenarios":"Thrown at crates/egui_extras/src/loaders/image_loader.rs:132 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d802a982ce959839d92f4f6718fdffa41143110e","analyzedAt":"2026-08-16T20:07:53.954Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}