mirror of https://gitee.com/bigwinds/arangodb
slightly simplified locking
This commit is contained in:
parent
9698fba8aa
commit
7c4b13f19d
|
@ -3372,17 +3372,16 @@ TRI_index_t* TRI_EnsureCapConstraintDocumentCollection (TRI_document_collection_
|
||||||
|
|
||||||
idx = CreateCapConstraintDocumentCollection(sim, size, 0, created);
|
idx = CreateCapConstraintDocumentCollection(sim, size, 0, created);
|
||||||
|
|
||||||
if (idx == NULL) {
|
|
||||||
TRI_WRITE_UNLOCK_DOCUMENTS_INDEXES_DOC_COLLECTION(sim);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
TRI_WRITE_UNLOCK_DOCUMENTS_INDEXES_DOC_COLLECTION(sim);
|
TRI_WRITE_UNLOCK_DOCUMENTS_INDEXES_DOC_COLLECTION(sim);
|
||||||
|
|
||||||
// .............................................................................
|
// .............................................................................
|
||||||
// outside write-lock
|
// outside write-lock
|
||||||
// .............................................................................
|
// .............................................................................
|
||||||
|
|
||||||
|
if (idx == NULL) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (created) {
|
if (created) {
|
||||||
res = TRI_SaveIndex(&sim->base, idx);
|
res = TRI_SaveIndex(&sim->base, idx);
|
||||||
|
|
||||||
|
@ -3738,17 +3737,16 @@ TRI_index_t* TRI_EnsureGeoIndex1DocumentCollection (TRI_document_collection_t* s
|
||||||
|
|
||||||
idx = CreateGeoIndexDocumentCollection(sim, location, NULL, NULL, geoJson, constraint, ignoreNull, 0, created);
|
idx = CreateGeoIndexDocumentCollection(sim, location, NULL, NULL, geoJson, constraint, ignoreNull, 0, created);
|
||||||
|
|
||||||
if (idx == NULL) {
|
|
||||||
TRI_WRITE_UNLOCK_DOCUMENTS_INDEXES_DOC_COLLECTION(sim);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
TRI_WRITE_UNLOCK_DOCUMENTS_INDEXES_DOC_COLLECTION(sim);
|
TRI_WRITE_UNLOCK_DOCUMENTS_INDEXES_DOC_COLLECTION(sim);
|
||||||
|
|
||||||
// .............................................................................
|
// .............................................................................
|
||||||
// outside write-lock
|
// outside write-lock
|
||||||
// .............................................................................
|
// .............................................................................
|
||||||
|
|
||||||
|
if (idx == NULL) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (created) {
|
if (created) {
|
||||||
res = TRI_SaveIndex(&sim->base, idx);
|
res = TRI_SaveIndex(&sim->base, idx);
|
||||||
|
|
||||||
|
@ -3780,17 +3778,16 @@ TRI_index_t* TRI_EnsureGeoIndex2DocumentCollection (TRI_document_collection_t* s
|
||||||
|
|
||||||
idx = CreateGeoIndexDocumentCollection(sim, NULL, latitude, longitude, false, constraint, ignoreNull, 0, created);
|
idx = CreateGeoIndexDocumentCollection(sim, NULL, latitude, longitude, false, constraint, ignoreNull, 0, created);
|
||||||
|
|
||||||
if (idx == NULL) {
|
|
||||||
TRI_WRITE_UNLOCK_DOCUMENTS_INDEXES_DOC_COLLECTION(sim);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
TRI_WRITE_UNLOCK_DOCUMENTS_INDEXES_DOC_COLLECTION(sim);
|
TRI_WRITE_UNLOCK_DOCUMENTS_INDEXES_DOC_COLLECTION(sim);
|
||||||
|
|
||||||
// .............................................................................
|
// .............................................................................
|
||||||
// outside write-lock
|
// outside write-lock
|
||||||
// .............................................................................
|
// .............................................................................
|
||||||
|
|
||||||
|
if (idx == NULL) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (created) {
|
if (created) {
|
||||||
res = TRI_SaveIndex(&sim->base, idx);
|
res = TRI_SaveIndex(&sim->base, idx);
|
||||||
|
|
||||||
|
@ -3987,17 +3984,16 @@ TRI_index_t* TRI_EnsureHashIndexDocumentCollection (TRI_document_collection_t* s
|
||||||
// given the list of attributes (as strings)
|
// given the list of attributes (as strings)
|
||||||
idx = CreateHashIndexDocumentCollection(sim, attributes, 0, unique, created);
|
idx = CreateHashIndexDocumentCollection(sim, attributes, 0, unique, created);
|
||||||
|
|
||||||
if (idx == NULL) {
|
|
||||||
TRI_WRITE_UNLOCK_DOCUMENTS_INDEXES_DOC_COLLECTION(sim);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
TRI_WRITE_UNLOCK_DOCUMENTS_INDEXES_DOC_COLLECTION(sim);
|
TRI_WRITE_UNLOCK_DOCUMENTS_INDEXES_DOC_COLLECTION(sim);
|
||||||
|
|
||||||
// .............................................................................
|
// .............................................................................
|
||||||
// outside write-lock
|
// outside write-lock
|
||||||
// .............................................................................
|
// .............................................................................
|
||||||
|
|
||||||
|
if (idx == NULL) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (created) {
|
if (created) {
|
||||||
res = TRI_SaveIndex(&sim->base, idx);
|
res = TRI_SaveIndex(&sim->base, idx);
|
||||||
|
|
||||||
|
@ -4189,17 +4185,16 @@ TRI_index_t* TRI_EnsureSkiplistIndexDocumentCollection (TRI_document_collection_
|
||||||
|
|
||||||
idx = CreateSkiplistIndexDocumentCollection(sim, attributes, 0, unique, created);
|
idx = CreateSkiplistIndexDocumentCollection(sim, attributes, 0, unique, created);
|
||||||
|
|
||||||
if (idx == NULL) {
|
|
||||||
TRI_WRITE_UNLOCK_DOCUMENTS_INDEXES_DOC_COLLECTION(sim);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
TRI_WRITE_UNLOCK_DOCUMENTS_INDEXES_DOC_COLLECTION(sim);
|
TRI_WRITE_UNLOCK_DOCUMENTS_INDEXES_DOC_COLLECTION(sim);
|
||||||
|
|
||||||
// .............................................................................
|
// .............................................................................
|
||||||
// outside write-lock
|
// outside write-lock
|
||||||
// .............................................................................
|
// .............................................................................
|
||||||
|
|
||||||
|
if (idx == NULL) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (created) {
|
if (created) {
|
||||||
res = TRI_SaveIndex(&sim->base, idx);
|
res = TRI_SaveIndex(&sim->base, idx);
|
||||||
|
|
||||||
|
@ -4439,17 +4434,16 @@ TRI_index_t* TRI_EnsurePriorityQueueIndexDocumentCollection(TRI_document_collect
|
||||||
// Given the list of attributes (as strings)
|
// Given the list of attributes (as strings)
|
||||||
idx = CreatePriorityQueueIndexDocumentCollection(sim, attributes, 0, unique, created);
|
idx = CreatePriorityQueueIndexDocumentCollection(sim, attributes, 0, unique, created);
|
||||||
|
|
||||||
if (idx == NULL) {
|
|
||||||
TRI_WRITE_UNLOCK_DOCUMENTS_INDEXES_DOC_COLLECTION(sim);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
TRI_WRITE_UNLOCK_DOCUMENTS_INDEXES_DOC_COLLECTION(sim);
|
TRI_WRITE_UNLOCK_DOCUMENTS_INDEXES_DOC_COLLECTION(sim);
|
||||||
|
|
||||||
// .............................................................................
|
// .............................................................................
|
||||||
// outside write-lock
|
// outside write-lock
|
||||||
// .............................................................................
|
// .............................................................................
|
||||||
|
|
||||||
|
if (idx == NULL) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (created) {
|
if (created) {
|
||||||
res = TRI_SaveIndex(&sim->base, idx);
|
res = TRI_SaveIndex(&sim->base, idx);
|
||||||
|
|
||||||
|
@ -4686,17 +4680,16 @@ TRI_index_t* TRI_EnsureBitarrayIndexDocumentCollection (TRI_document_collection_
|
||||||
|
|
||||||
idx = CreateBitarrayIndexDocumentCollection(sim, attributes, values, 0, supportUndef, created);
|
idx = CreateBitarrayIndexDocumentCollection(sim, attributes, values, 0, supportUndef, created);
|
||||||
|
|
||||||
if (idx == NULL) {
|
|
||||||
TRI_WRITE_UNLOCK_DOCUMENTS_INDEXES_DOC_COLLECTION(sim);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
TRI_WRITE_UNLOCK_DOCUMENTS_INDEXES_DOC_COLLECTION(sim);
|
TRI_WRITE_UNLOCK_DOCUMENTS_INDEXES_DOC_COLLECTION(sim);
|
||||||
|
|
||||||
// .............................................................................
|
// .............................................................................
|
||||||
// outside write-lock
|
// outside write-lock
|
||||||
// .............................................................................
|
// .............................................................................
|
||||||
|
|
||||||
|
if (idx == NULL) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (created) {
|
if (created) {
|
||||||
res = TRI_SaveIndex(&sim->base, idx);
|
res = TRI_SaveIndex(&sim->base, idx);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue