| 869 | |
| 870 | private: |
| 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 |
no test coverage detected