Changeset 174 for trunk/src/dnmalloc.c


Ignore:
Timestamp:
Aug 27, 2008, 5:40:28 PM (16 years ago)
Author:
katerina
Message:

Fix for tickets #112, #113 (dnmalloc deadlock on fork, hostname portability in test script).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/dnmalloc.c

    r173 r174  
    15081508    pthread_mutex_unlock(&mALLOC_MUTEx);
    15091509}
    1510 void dnmalloc_fork_child(void) {
     1510void dnmalloc_fork_child(void) {
     1511  int rc;
    15111512#ifdef __GLIBC__
    15121513  if (dnmalloc_use_mutex)
    1513     pthread_mutex_init(&mALLOC_MUTEx, NULL);
     1514    {
     1515      pthread_mutex_unlock (&mALLOC_MUTEx);
     1516      pthread_mutex_destroy(&mALLOC_MUTEx);
     1517      rc = pthread_mutex_init(&mALLOC_MUTEx, NULL);
     1518    }
    15141519#else
    15151520  if (dnmalloc_use_mutex)
    1516     pthread_mutex_unlock(&mALLOC_MUTEx);
    1517 #endif
     1521    rc = pthread_mutex_unlock(&mALLOC_MUTEx);
     1522#endif
     1523  if (rc != 0)
     1524    {
     1525      fputs("fork_child failed", stderr);
     1526      _exit(EXIT_FAILURE);
     1527    }
    15181528}
    15191529static int dnmalloc_mutex_lock(pthread_mutex_t *mutex)
Note: See TracChangeset for help on using the changeset viewer.