Fix linux mutexes to be recursive; tombstone the old unix code

master
Allen Webster 2020-02-27 18:38:00 -08:00
parent cf961d4b3a
commit a510ae5dce
5 changed files with 12 additions and 1 deletions

View File

@ -554,7 +554,10 @@ internal System_Mutex
system_mutex_make(void){ system_mutex_make(void){
System_Mutex result = {}; System_Mutex result = {};
Linux_Object* object = linux_alloc_object(LinuxObjectKind_Mutex); 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_Object**)&result = object;
//LINUX_FN_DEBUG("%p", object); //LINUX_FN_DEBUG("%p", object);
return result; return result;

View File

@ -9,6 +9,8 @@
// TOP // TOP
#error IS THIS STILL REAL? (February 27th 2020)
#if !defined(FD_CHECK) #if !defined(FD_CHECK)
#define FD_CHECK() #define FD_CHECK()
#endif #endif

View File

@ -9,6 +9,8 @@
// TOP // TOP
#error IS THIS STILL REAL? (February 27th 2020)
#include <sys/mman.h> #include <sys/mman.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>

View File

@ -9,6 +9,8 @@
// TOP // TOP
#error IS THIS STILL REAL? (February 27th 2020)
union Library{ union Library{
void *lib; void *lib;
FixSize(LIBRARY_TYPE_SIZE); FixSize(LIBRARY_TYPE_SIZE);

View File

@ -9,6 +9,8 @@
// TOP // TOP
#error IS THIS STILL REAL? (February 27th 2020)
#if !defined(MAC_THREADING_WRAPPER) #if !defined(MAC_THREADING_WRAPPER)
#define MAC_THREADING_WRAPPER #define MAC_THREADING_WRAPPER