| 2295 | } |
| 2296 | |
| 2297 | void MultiVersionApi::addExternalLibraryDirectory(std::string path) { |
| 2298 | TraceEvent("AddingExternalClientDirectory").detail("Directory", path); |
| 2299 | std::vector<std::string> files = platform::listFiles(path, DYNAMIC_LIB_EXT); |
| 2300 | |
| 2301 | MutexHolder holder(lock); |
| 2302 | if (networkStartSetup) { |
| 2303 | throw invalid_option(); // SOMEDAY: it might be good to allow clients to be added after the network is setup |
| 2304 | } |
| 2305 | |
| 2306 | // external libraries always run on their own thread; ensure we allocate at least one thread to run this library. |
| 2307 | threadCount = std::max(threadCount, 1); |
| 2308 | |
| 2309 | for (auto filename : files) { |
| 2310 | std::string lib = abspath(joinPath(path, filename)); |
| 2311 | if (externalClientDescriptions.count(filename) == 0) { |
| 2312 | TraceEvent("AddingExternalClient").detail("LibraryPath", filename); |
| 2313 | externalClientDescriptions.emplace(std::make_pair(filename, ClientDesc(lib, true, false))); |
| 2314 | } |
| 2315 | } |
| 2316 | } |
| 2317 | #if defined(__unixish__) |
| 2318 | std::vector<std::pair<std::string, bool>> MultiVersionApi::copyExternalLibraryPerThread(std::string path) { |
| 2319 | ASSERT_GE(threadCount, 1); |
nothing calls this directly
no test coverage detected