Пример #1
0
void TRI_DestroyBarrierList (TRI_barrier_list_t* container) {
  TRI_barrier_t* ptr;
  TRI_barrier_t* next;

  ptr = container->_begin;

  while (ptr != NULL) {
    ptr->_container = NULL;
    next = ptr->_next;

    if (ptr->_type == TRI_BARRIER_COLLECTION_UNLOAD_CALLBACK ||
        ptr->_type == TRI_BARRIER_COLLECTION_DROP_CALLBACK ||
        ptr->_type == TRI_BARRIER_DATAFILE_DROP_CALLBACK ||
        ptr->_type == TRI_BARRIER_DATAFILE_RENAME_CALLBACK ||
        ptr->_type == TRI_BARRIER_COLLECTION_COMPACTION) {

      // free data still allocated in barrier elements
      FreeDataBarrier(ptr);

      TRI_Free(TRI_UNKNOWN_MEM_ZONE, ptr);
    }
    else if (ptr->_type == TRI_BARRIER_ELEMENT) {
      LOG_ERROR("logic error. shouldn't have barrier elements in barrierlist on unload");
    }
    else {
      LOG_ERROR("unknown barrier type");
    }

    ptr = next;
  }

  TRI_DestroySpin(&container->_lock);
}
Пример #2
0
void TRI_FreeStoreGeneralCursor (TRI_general_cursor_store_t* store) {
  // force deletion of all remaining cursors
  TRI_CleanupGeneralCursor(store, true);

  TRI_DestroySpin(&store->_lock);
  TRI_DestroyAssociativePointer(&store->_ids);
  TRI_Free(TRI_UNKNOWN_MEM_ZONE, store);
}
Пример #3
0
void TRI_DestroyReplicationApplier (TRI_replication_applier_t* applier) {
  TRI_StopReplicationApplier(applier, true);
  
  TRI_DestroyStateReplicationApplier(&applier->_state);
  TRI_DestroyConfigurationReplicationApplier(&applier->_configuration);
  TRI_FreeString(TRI_CORE_MEM_ZONE, applier->_databaseName);
  TRI_DestroyCondition(&applier->_runStateChangeCondition);
  TRI_DestroySpin(&applier->_threadLock);
  TRI_DestroyReadWriteLock(&applier->_statusLock);
}
Пример #4
0
void TRI_FreeGeneralCursor (TRI_general_cursor_t* cursor) {
  if (cursor->_extra != NULL) {
    TRI_FreeJson(TRI_UNKNOWN_MEM_ZONE, cursor->_extra);
  }

  TRI_FreeCursorResult(cursor->_result);

  TRI_DestroySpin(&cursor->_lock);
  TRI_Free(TRI_UNKNOWN_MEM_ZONE, cursor);

  LOG_TRACE("destroyed general cursor");
}