예제 #1
0
파일: client.cpp 프로젝트: Machyne/mongo
void Client::initThread(const char* desc,
                        ServiceContext* service,
                        transport::SessionHandle session) {
    invariant(currentClient.getMake()->get() == nullptr);

    std::string fullDesc;
    if (session) {
        fullDesc = str::stream() << desc << session->id();
    } else {
        fullDesc = desc;
    }

    setThreadName(fullDesc.c_str());

    // Create the client obj, attach to thread
    *currentClient.get() = service->makeClient(fullDesc, std::move(session));
}
예제 #2
0
파일: client.cpp 프로젝트: Machyne/mongo
void Client::destroy() {
    invariant(currentClient.get());
    invariant(currentClient.get()->get());
    currentClient.reset(nullptr);
}