Changeset 21295
- Timestamp:
- Feb 4, 2009, 1:37:10 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20090203/psLib/src/sys/psMemory.c
r19128 r21295 10 10 * @author Joshua Hoblitt, University of Hawaii 11 11 * 12 * @version $Revision: 1.100 $ $Name: not supported by cvs2svn $13 * @date $Date: 200 8-08-20 02:00:20 $12 * @version $Revision: 1.100.22.1 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2009-02-04 23:37:10 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 736 736 // XXX we probably need a MUTEX_LOCK here: otherwise, two functions can race on recCounter++ and 737 737 // refCounter--; 738 MUTEX_LOCK(&memBlockListMutex); 738 739 memBlock->refCounter++; 740 MUTEX_UNLOCK(&memBlockListMutex); 739 741 740 742 // Did the user ask to be informed about this allocation? … … 802 804 // if we have multiple references, just decrement the count and return. 803 805 // XXX we probably need a MUTEX_LOCK here: otherwise, two functions can race on refCounter--; 806 MUTEX_LOCK(&memBlockListMutex); 804 807 if (memBlock->refCounter > 1) { 805 808 memBlock->refCounter--; 806 809 807 810 // Did the user ask to be informed about this deallocation? 808 MUTEX_LOCK(&memBlockListMutex);809 811 if (memBlock->id == p_psMemFreeID) { 810 812 p_psMemFreeID += memFreeCallback(memBlock); … … 813 815 return ptr; 814 816 } 817 MUTEX_UNLOCK(&memBlockListMutex); 815 818 816 819 // we can't invoke freeFunc() while we're holding memBlockListMutex as it
Note:
See TracChangeset
for help on using the changeset viewer.
