diff --git a/CHANGELOG.md b/CHANGELOG.md index e27cf5ff..2b3b767f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ - On macOS, add `NSWindow.hasShadow` support. - **Breaking:** On Web, `set_cursor_position` and `set_cursor_grab` will now always return an error. - **Breaking:** `PixelDelta` scroll events now return a `PhysicalPosition`. +- On NetBSD, fixed crash due to incorrect detection of the main thread. # 0.22.2 (2020-05-16) diff --git a/src/platform_impl/linux/mod.rs b/src/platform_impl/linux/mod.rs index 0fee6832..73b84777 100644 --- a/src/platform_impl/linux/mod.rs +++ b/src/platform_impl/linux/mod.rs @@ -730,7 +730,5 @@ fn is_main_thread() -> bool { #[cfg(target_os = "netbsd")] fn is_main_thread() -> bool { - use libc::_lwp_self; - - unsafe { _lwp_self() == 1 } + std::thread::current().name() == Some("main") }