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

Method clearDeliveryThread

src/jrd/Mapping.cpp:871–912  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

869
870private:
871 void clearDeliveryThread()
872 {
873 bool startup = true;
874 try
875 {
876 MappingHeader::Process* p = &sharedMemory->getHeader()->process[process];
877 while (p->flags & MappingHeader::FLAG_ACTIVE)
878 {
879 SLONG value = sharedMemory->eventClear(&p->notifyEvent);
880
881 if (p->flags & MappingHeader::FLAG_DELIVER)
882 {
883 MappingHeader* sMem = sharedMemory->getHeader();
884 resetMap(sMem->databaseForReset, sMem->resetIndex);
885 p->flags &= ~MappingHeader::FLAG_DELIVER;
886
887 MappingHeader::Process* cur = &sMem->process[sMem->currentProcess];
888 if (sharedMemory->eventPost(&cur->callbackEvent) != FB_SUCCESS)
889 {
890 (Arg::Gds(isc_map_event) << "POST").raise();
891 }
892 }
893
894 if (startup)
895 {
896 startup = false;
897 startupSemaphore.release();
898 }
899
900 if (sharedMemory->eventWait(&p->notifyEvent, value, 0) != FB_SUCCESS)
901 {
902 (Arg::Gds(isc_map_event) << "WAIT").raise();
903 }
904 }
905 if (startup)
906 startupSemaphore.release();
907 }
908 catch (const Exception& ex)
909 {
910 exceptionHandler(ex, nullptr);
911 }
912 }
913
914 // implement pure virtual functions
915 bool initialize(SharedMemoryBase* sm, bool initFlag) override

Callers 1

clearDeliveryMethod · 0.80

Calls 8

resetMapFunction · 0.85
GdsClass · 0.85
eventClearMethod · 0.80
eventPostMethod · 0.80
eventWaitMethod · 0.80
getHeaderMethod · 0.45
raiseMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected