mirror of https://gitee.com/bigwinds/arangodb
fixed some locking issues
This commit is contained in:
parent
0712114f27
commit
112019c7e2
|
@ -143,6 +143,7 @@ bool TRI_ContainsBarrierList (TRI_barrier_list_t* container, TRI_barrier_type_e
|
||||||
|
|
||||||
while (ptr != NULL) {
|
while (ptr != NULL) {
|
||||||
if (ptr->_type == type) {
|
if (ptr->_type == type) {
|
||||||
|
TRI_UnlockSpin(&container->_lock);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
ptr = ptr->_next;
|
ptr = ptr->_next;
|
||||||
|
|
|
@ -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);
|
aids = TRI_Allocate(shaper->_memoryZone, len * sizeof(TRI_shape_aid_t), false);
|
||||||
|
|
||||||
if (aids == NULL) {
|
if (aids == NULL) {
|
||||||
|
TRI_UnlockMutex(&shaper->_attributePathLock);
|
||||||
|
LOG_ERROR("out of memory in shaper");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer = ptr = TRI_DuplicateString2Z(shaper->_memoryZone, name, len);
|
buffer = ptr = TRI_DuplicateString2Z(shaper->_memoryZone, name, len);
|
||||||
|
|
||||||
if (buffer == NULL) {
|
if (buffer == NULL) {
|
||||||
|
TRI_UnlockMutex(&shaper->_attributePathLock);
|
||||||
TRI_Free(shaper->_memoryZone, aids);
|
TRI_Free(shaper->_memoryZone, aids);
|
||||||
|
LOG_ERROR("out of memory in shaper");
|
||||||
return 0;
|
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);
|
result = TRI_Allocate(shaper->_memoryZone, total, false);
|
||||||
|
|
||||||
if (result == NULL) {
|
if (result == NULL) {
|
||||||
|
TRI_UnlockMutex(&shaper->_attributePathLock);
|
||||||
|
TRI_Free(shaper->_memoryZone, aids);
|
||||||
|
LOG_ERROR("out of memory in shaper");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue