From a510ae5dcec44d757c444dd32288c2615c7e36bb Mon Sep 17 00:00:00 2001 From: Allen Webster Date: Thu, 27 Feb 2020 18:38:00 -0800 Subject: [PATCH] Fix linux mutexes to be recursive; tombstone the old unix code --- platform_linux/linux_4ed_functions.cpp | 5 ++++- platform_unix/unix_4ed_functions.cpp | 2 ++ platform_unix/unix_4ed_headers.h | 2 ++ platform_unix/unix_library_wrapper.h | 2 ++ platform_unix/unix_threading_wrapper.h | 2 ++ 5 files changed, 12 insertions(+), 1 deletion(-) diff --git a/platform_linux/linux_4ed_functions.cpp b/platform_linux/linux_4ed_functions.cpp index 1d250e6e..9d005377 100644 --- a/platform_linux/linux_4ed_functions.cpp +++ b/platform_linux/linux_4ed_functions.cpp @@ -554,7 +554,10 @@ internal System_Mutex system_mutex_make(void){ System_Mutex result = {}; Linux_Object* object = linux_alloc_object(LinuxObjectKind_Mutex); - pthread_mutex_init(&object->mutex, NULL); + pthread_mutexattr_t attr; + pthread_mutexattr_init(&attr); + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); + pthread_mutex_init(&object->mutex, &attr); *(Linux_Object**)&result = object; //LINUX_FN_DEBUG("%p", object); return result; diff --git a/platform_unix/unix_4ed_functions.cpp b/platform_unix/unix_4ed_functions.cpp index d6fe65b7..693d6e15 100644 --- a/platform_unix/unix_4ed_functions.cpp +++ b/platform_unix/unix_4ed_functions.cpp @@ -9,6 +9,8 @@ // TOP +#error IS THIS STILL REAL? (February 27th 2020) + #if !defined(FD_CHECK) #define FD_CHECK() #endif diff --git a/platform_unix/unix_4ed_headers.h b/platform_unix/unix_4ed_headers.h index 7548359b..2a48e541 100644 --- a/platform_unix/unix_4ed_headers.h +++ b/platform_unix/unix_4ed_headers.h @@ -9,6 +9,8 @@ // TOP +#error IS THIS STILL REAL? (February 27th 2020) + #include #include #include diff --git a/platform_unix/unix_library_wrapper.h b/platform_unix/unix_library_wrapper.h index 0af75f92..b358ce34 100644 --- a/platform_unix/unix_library_wrapper.h +++ b/platform_unix/unix_library_wrapper.h @@ -9,6 +9,8 @@ // TOP +#error IS THIS STILL REAL? (February 27th 2020) + union Library{ void *lib; FixSize(LIBRARY_TYPE_SIZE); diff --git a/platform_unix/unix_threading_wrapper.h b/platform_unix/unix_threading_wrapper.h index a8d1afd9..15af8bd2 100644 --- a/platform_unix/unix_threading_wrapper.h +++ b/platform_unix/unix_threading_wrapper.h @@ -9,6 +9,8 @@ // TOP +#error IS THIS STILL REAL? (February 27th 2020) + #if !defined(MAC_THREADING_WRAPPER) #define MAC_THREADING_WRAPPER