1
0
Fork 0

fixed some locking issues

This commit is contained in:
Jan Steemann 2012-09-07 17:18:16 +02:00
parent 0712114f27
commit 112019c7e2
2 changed files with 8 additions and 0 deletions

View File

@ -143,6 +143,7 @@ bool TRI_ContainsBarrierList (TRI_barrier_list_t* container, TRI_barrier_type_e
while (ptr != NULL) {
if (ptr->_type == type) {
TRI_UnlockSpin(&container->_lock);
return true;
}
ptr = ptr->_next;

View File

@ -224,13 +224,17 @@ static TRI_shape_pid_t FindNameAttributePath (TRI_shaper_t* shaper, char const*
aids = TRI_Allocate(shaper->_memoryZone, len * sizeof(TRI_shape_aid_t), false);
if (aids == NULL) {
TRI_UnlockMutex(&shaper->_attributePathLock);
LOG_ERROR("out of memory in shaper");
return 0;
}
buffer = ptr = TRI_DuplicateString2Z(shaper->_memoryZone, name, len);
if (buffer == NULL) {
TRI_UnlockMutex(&shaper->_attributePathLock);
TRI_Free(shaper->_memoryZone, aids);
LOG_ERROR("out of memory in shaper");
return 0;
}
@ -256,6 +260,9 @@ static TRI_shape_pid_t FindNameAttributePath (TRI_shaper_t* shaper, char const*
result = TRI_Allocate(shaper->_memoryZone, total, false);
if (result == NULL) {
TRI_UnlockMutex(&shaper->_attributePathLock);
TRI_Free(shaper->_memoryZone, aids);
LOG_ERROR("out of memory in shaper");
return 0;
}