aboutsummaryrefslogtreecommitdiff
path: root/core/thread
diff options
context:
space:
mode:
authorFeoramund <161657516+Feoramund@users.noreply.github.com>2024-04-22 17:16:33 -0400
committerFeoramund <161657516+Feoramund@users.noreply.github.com>2024-04-22 17:16:33 -0400
commit9cdb7b2584492a76fec6a49998e2937e4b1a78c3 (patch)
treeb68486903e42f9d22a66d816b35e705d0113d252 /core/thread
parentcaa8863c972a82c3d43fda9d56f3b41f90b2fe54 (diff)
Fix discrepancy with pthread cancelability state
Diffstat (limited to 'core/thread')
-rw-r--r--core/thread/thread_unix.odin4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/thread/thread_unix.odin b/core/thread/thread_unix.odin
index c75710873..290f86eac 100644
--- a/core/thread/thread_unix.odin
+++ b/core/thread/thread_unix.odin
@@ -25,7 +25,7 @@ _create :: proc(procedure: Thread_Proc, priority: Thread_Priority) -> ^Thread {
when ODIN_OS != .Darwin {
// We need to give the thread a moment to start up before we enable cancellation.
- can_set_thread_cancel_state := unix.pthread_setcancelstate(unix.PTHREAD_CANCEL_DISABLE, nil) == 0
+ can_set_thread_cancel_state := unix.pthread_setcancelstate(unix.PTHREAD_CANCEL_ENABLE, nil) == 0
}
sync.lock(&t.mutex)
@@ -40,7 +40,7 @@ _create :: proc(procedure: Thread_Proc, priority: Thread_Priority) -> ^Thread {
// Enable thread's cancelability.
if can_set_thread_cancel_state {
unix.pthread_setcanceltype (unix.PTHREAD_CANCEL_ASYNCHRONOUS, nil)
- unix.pthread_setcancelstate(unix.PTHREAD_CANCEL_DISABLE, nil)
+ unix.pthread_setcancelstate(unix.PTHREAD_CANCEL_ENABLE, nil)
}
}