BBlockCache: Initialize the mutex unconditionally.
Otherwise we may get assertion failures under the debug heaps.
This commit is contained in:
@@ -45,6 +45,8 @@ BBlockCache::BBlockCache(uint32 blockCount, size_t blockSize,
|
||||
fFreeBlocks(0),
|
||||
fBlockCount(blockCount)
|
||||
{
|
||||
pthread_mutex_init(&fLock, NULL);
|
||||
|
||||
switch (allocationType) {
|
||||
case B_OBJECT_CACHE:
|
||||
fAlloc = &operator new[];
|
||||
@@ -61,8 +63,6 @@ BBlockCache::BBlockCache(uint32 blockCount, size_t blockSize,
|
||||
if (heap_debug_get_allocation_info != NULL)
|
||||
return;
|
||||
|
||||
pthread_mutex_init(&fLock, NULL);
|
||||
|
||||
// To properly maintain a list of free buffers, a buffer must be
|
||||
// large enough to contain the _FreeBlock struct that is used.
|
||||
if (blockSize < sizeof(_FreeBlock))
|
||||
|
||||
Reference in New Issue
Block a user