MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / process_thread

Function process_thread

src/remote/server/ReplServer.cpp:1022–1055  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1020 }
1021
1022 THREAD_ENTRY_DECLARE process_thread(THREAD_ENTRY_PARAM arg)
1023 {
1024 AutoPtr<Target> target(static_cast<Target*>(arg));
1025 const auto config = target->getConfig();
1026 const auto dbName = config->dbName.c_str();
1027
1028 AutoMemoryPool workingPool(MemoryPool::createPool());
1029 ContextPoolHolder threadContext(workingPool);
1030
1031 target->verbose("Started replication for database %s", dbName);
1032
1033 while (!shutdownFlag)
1034 {
1035 const ProcessStatus ret = process_archive(*workingPool, target);
1036
1037 if (ret == PROCESS_CONTINUE)
1038 continue;
1039
1040 target->shutdown();
1041
1042 if (ret != PROCESS_SHUTDOWN)
1043 {
1044 const ULONG timeout =
1045 (ret == PROCESS_SUSPEND) ? config->applyIdleTimeout : config->applyErrorTimeout;
1046
1047 shutdownSemaphore.tryEnter(timeout);
1048 }
1049 }
1050
1051 target->verbose("Finished replication for database %s", dbName);
1052 --activeThreads;
1053
1054 return 0;
1055 }
1056}
1057
1058

Callers

nothing calls this directly

Calls 6

process_archiveFunction · 0.85
verboseMethod · 0.80
getConfigMethod · 0.45
c_strMethod · 0.45
shutdownMethod · 0.45
tryEnterMethod · 0.45

Tested by

no test coverage detected