Skip to content

Commit

Permalink
assert_main_thread is not needed by any backend
Browse files Browse the repository at this point in the history
  • Loading branch information
maan2003 committed Oct 3, 2021
1 parent 23366fc commit 3af1bd7
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions druid-shell/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,6 @@ fn current_thread_id() -> u64 {
unsafe { mem::transmute(thread::current().id()) }
}

/// Assert that the current thread is the registered main thread.
///
/// # Panics
///
/// Panics when called from a non-main thread.
#[cfg(not(target_os = "linux"))]
pub(crate) fn assert_main_thread() {
let thread_id = current_thread_id();
let main_thread_id = MAIN_THREAD_ID.load(Ordering::Acquire);
if thread_id != main_thread_id {
panic!(
"Main thread assertion failed {} != {}",
thread_id, main_thread_id
);
}
}

/// Assert that the current thread is the registered main thread or main thread is not claimed.
///
/// # Panics
Expand Down

0 comments on commit 3af1bd7

Please sign in to comment.