コード例 #1
0
void AbstractOplogFetcher::_finishCallback(Status status) {
    invariant(isActive());

    _onShutdownCallbackFn(status);

    decltype(_onShutdownCallbackFn) onShutdownCallbackFn;
    stdx::lock_guard<stdx::mutex> lock(_mutex);
    _transitionToComplete_inlock();

    // Release any resources that might be held by the '_onShutdownCallbackFn' function object.
    // The function object will be destroyed outside the lock since the temporary variable
    // 'onShutdownCallbackFn' is declared before 'lock'.
    invariant(_onShutdownCallbackFn);
    std::swap(_onShutdownCallbackFn, onShutdownCallbackFn);
}
コード例 #2
0
ファイル: oplog_fetcher.cpp プロジェクト: ChineseDr/mongo
void OplogFetcher::_onShutdown(Status status, OpTimeWithHash opTimeWithHash) {
    _onShutdownCallbackFn(status, opTimeWithHash);
}