Parcourir la source

* fix heap mutex deadlock in case of runtime error within heap management (needs recursive heap mutex)

git-svn-id: trunk@7337 -
micha il y a 18 ans
Parent
commit
6ec55d2e74
1 fichiers modifiés avec 4 ajouts et 4 suppressions
  1. 4 4
      rtl/unix/cthreads.pp

+ 4 - 4
rtl/unix/cthreads.pp

@@ -520,22 +520,22 @@ end;
 
     procedure PThreadHeapMutexInit;
       begin
-         pthread_mutex_init(@heapmutex,nil);
+         CInitCriticalSection(heapmutex);
       end;
 
     procedure PThreadHeapMutexDone;
       begin
-         pthread_mutex_destroy(@heapmutex);
+         CDoneCriticalSection(heapmutex);
       end;
 
     procedure PThreadHeapMutexLock;
       begin
-         pthread_mutex_lock(@heapmutex);
+         CEnterCriticalSection(heapmutex);
       end;
 
     procedure PThreadHeapMutexUnlock;
       begin
-         pthread_mutex_unlock(@heapmutex);
+         CLeaveCriticalSection(heapmutex);
       end;
 
     const