IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 1821


Ignore:
Timestamp:
Sep 16, 2004, 1:51:07 PM (22 years ago)
Author:
evanalst
Message:

Add unlock/lock mutex to psMemCheckCorruption to allow tst_psMemory to
run successfully on Mac.

Location:
trunk/psLib/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/sys/psMemory.c

    r1810 r1821  
    88*  @author Robert Lupton, Princeton University
    99*
    10 *  @version $Revision: 1.38 $ $Name: not supported by cvs2svn $
    11 *  @date $Date: 2004-09-14 23:48:25 $
     10*  @version $Revision: 1.39 $ $Name: not supported by cvs2svn $
     11*  @date $Date: 2004-09-16 23:51:07 $
    1212*
    1313*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    261261{
    262262    int nbad = 0;               // number of bad blocks
     263    bool failure = false;
    263264
    264265    // get exclusive access to the memBlock list to avoid it changing on us while we use it.
    265     pthread_mutex_lock(&memBlockListMutex);
     266    //    pthread_mutex_lock(&memBlockListMutex);
    266267
    267268    for (psMemBlock* iter = lastMemBlockAllocated; iter != NULL; iter = iter->nextBlock) {
    268         if (checkMemBlock(iter, __func__)) {
     269        pthread_mutex_unlock(&memBlockListMutex);
     270        failure = checkMemBlock(iter, __func__);
     271        pthread_mutex_lock(&memBlockListMutex);
     272        if ( failure ) {
    269273            nbad++;
    270274
  • trunk/psLib/src/sysUtils/psMemory.c

    r1810 r1821  
    88*  @author Robert Lupton, Princeton University
    99*
    10 *  @version $Revision: 1.38 $ $Name: not supported by cvs2svn $
    11 *  @date $Date: 2004-09-14 23:48:25 $
     10*  @version $Revision: 1.39 $ $Name: not supported by cvs2svn $
     11*  @date $Date: 2004-09-16 23:51:07 $
    1212*
    1313*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    261261{
    262262    int nbad = 0;               // number of bad blocks
     263    bool failure = false;
    263264
    264265    // get exclusive access to the memBlock list to avoid it changing on us while we use it.
    265     pthread_mutex_lock(&memBlockListMutex);
     266    //    pthread_mutex_lock(&memBlockListMutex);
    266267
    267268    for (psMemBlock* iter = lastMemBlockAllocated; iter != NULL; iter = iter->nextBlock) {
    268         if (checkMemBlock(iter, __func__)) {
     269        pthread_mutex_unlock(&memBlockListMutex);
     270        failure = checkMemBlock(iter, __func__);
     271        pthread_mutex_lock(&memBlockListMutex);
     272        if ( failure ) {
    269273            nbad++;
    270274
Note: See TracChangeset for help on using the changeset viewer.