MCPcopy Create free account
hub / github.com/Logicalshift/flo_draw / glutin_thread

Function glutin_thread

draw/src/glutin_thread.rs:37–50  ·  view source on GitHub ↗

Creates or retrieves the glutin thread

()

Source from the content-addressed store, hash-verified

35/// Creates or retrieves the glutin thread
36///
37pub fn glutin_thread() -> Arc<GlutinThread> {
38 GLUTIN_THREAD.sync(|thread| {
39 if let Some(thread) = thread {
40 // Thread is already running
41 Arc::clone(thread)
42 } else {
43 // Need to start a new thread
44 let new_thread = create_glutin_thread();
45 *thread = Some(Arc::clone(&new_thread));
46
47 new_thread
48 }
49 })
50}
51
52struct StopGlutinWhenDropped;
53impl Drop for StopGlutinWhenDropped {

Callers 5

dropMethod · 0.85
handle_thread_eventMethod · 0.85
wake_by_refMethod · 0.85

Calls 1

create_glutin_threadFunction · 0.85

Tested by

no test coverage detected