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

Method shutdownServices

src/jrd/svc.cpp:1007–1040  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1005
1006
1007void Service::shutdownServices()
1008{
1009 svcShutdown = true;
1010
1011 MutexLockGuard guard(globalServicesMutex, FB_FUNCTION);
1012 AllServices& all(allServices);
1013
1014 unsigned int pos;
1015
1016 // signal once for every still running service
1017 for (pos = 0; pos < all.getCount(); pos++)
1018 {
1019 if (!(all[pos]->svc_flags & SVC_finished))
1020 all[pos]->svc_detach_sem.release();
1021 if (all[pos]->svc_stdin_size_requested)
1022 all[pos]->svc_stdin_semaphore.release();
1023 }
1024
1025 for (pos = 0; pos < all.getCount(); )
1026 {
1027 if (!(all[pos]->svc_flags & SVC_finished))
1028 {
1029 globalServicesMutex->leave();
1030 Thread::sleep(1);
1031 globalServicesMutex->enter(FB_FUNCTION);
1032 pos = 0;
1033 continue;
1034 }
1035
1036 ++pos;
1037 }
1038
1039 threadCollect->join();
1040}
1041
1042
1043ISC_STATUS Service::query2(thread_db* /*tdbb*/,

Callers

nothing calls this directly

Calls 6

sleepFunction · 0.50
getCountMethod · 0.45
releaseMethod · 0.45
leaveMethod · 0.45
enterMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected