派生自 development/c++

xuxiuxi
2019-03-07 f2ac06cd25abc8d69ceeb0b19abdb5051d9fcf41
QiaoJiaSystem/VideoAnalysFromHC/RtspAnalysElement.cpp
@@ -10,24 +10,24 @@
//RtspAnalysElement::RtspAnalysElement() {}
//std::string RtspAnalysElement::resetFdfs(std::string ip, unsigned int port, std::string content) {
//
//    std::thread reset([&]() {
//        fdfsClient.rwLock.rdlock();
//        if (fdfsClient.fastFds != nullptr) {
//            delete fdfsClient.fastFds;
//        }
//        fdfsClient.fastFds = new FastFds("fastDfsClient.conf");
//        fdfsClient.rwLock.unlock();
//    });
//    reset.detach();
//
//    return "";
//}
std::string RtspAnalysElement::resetFdfs(std::string ip, unsigned int port, std::string content) {
    std::thread reset([&]() {
        fdfsClient.rwLock.rdlock();
        if (fdfsClient.fastFds != nullptr) {
            delete fdfsClient.fastFds;
        }
        fdfsClient.fastFds = new FastFds("fastDfsClient.conf");
        fdfsClient.rwLock.unlock();
    });
    reset.detach();
    return "";
}
RtspAnalysElement::RtspAnalysElement(LDBTool *_dbTool) : m_lDBTool(_dbTool), maxCount(50), currentCount(0) {
    init();
//    resetFdfs();
    resetFdfs();
    {
//        std::thread httpServer([&]() {
//            //#todo port