Browse Source

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

git-svn-id: trunk@7337 -
micha 18 years ago
parent
commit
6ec55d2e74
1 changed files with 4 additions and 4 deletions
  1. 4 4
      rtl/unix/cthreads.pp

+ 4 - 4
rtl/unix/cthreads.pp

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