History

windows fix

Spencer Salazar committed 6 years ago

Commit 2cb4b3d1 parent 5e02dfc1 file · +9 −1Browse files

Showing the changes to src/core/util_thread.cpp (1 of 1 file). Show all

Unified · Split

src/core/util_thread.cpp+9−1
@@ -67,7 +67,15 @@ XThread::XThread( ) · 66 unmodified lines
6767 //-----------------------------------------------------------------------------
6868 XThread::~XThread( )
6969 {
70− if( thread != 0 && thread != pthread_self() )
70+#if defined(__PLATFORM_MACOSX__) || defined(__PLATFORM_LINUX__) || defined(__WINDOWS_PTHREAD__)
71+ // cant terminate self
72+ bool is_self_thread = (thread != pthread_self());
73+#elif defined(__PLATFORM_WIN32__)
74+ // ignore for now
75+ bool is_self_thread = false;
76+#endif
77+
78+ if( thread != 0 && !is_self_thread)
7179 {
7280 #if defined(__PLATFORM_MACOSX__) || defined(__PLATFORM_LINUX__) || defined(__WINDOWS_PTHREAD__)
7381 pthread_cancel(thread);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t