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

Function execute_looper

src/jrd/exe.cpp:1004–1098  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1002
1003
1004static void execute_looper(thread_db* tdbb,
1005 Request* request,
1006 jrd_tra* transaction,
1007 const StmtNode* node,
1008 Request::req_s next_state)
1009{
1010/**************************************
1011 *
1012 * e x e c u t e _ l o o p e r
1013 *
1014 **************************************
1015 *
1016 * Functional description
1017 * Wrapper around looper. This will execute
1018 * looper with the save point mechanism.
1019 *
1020 **************************************/
1021 DEV_BLKCHK(request, type_req);
1022
1023 SET_TDBB(tdbb);
1024 Jrd::Attachment* const attachment = tdbb->getAttachment();
1025
1026 // Ensure the cancellation lock can be triggered
1027
1028 Lock* const lock = attachment->att_cancel_lock;
1029 if (lock && lock->lck_logical == LCK_none)
1030 LCK_lock(tdbb, lock, LCK_SR, LCK_WAIT);
1031
1032 // Start a save point
1033
1034 SavNumber savNumber = 0;
1035
1036 if (!(request->req_flags & req_proc_fetch) && request->req_transaction)
1037 {
1038 if (transaction && !(transaction->tra_flags & TRA_system))
1039 {
1040 if (request->req_savepoints)
1041 {
1042 request->req_savepoints =
1043 request->req_savepoints->moveToStack(transaction->tra_save_point);
1044 }
1045 else
1046 transaction->startSavepoint();
1047
1048 savNumber = transaction->tra_save_point->getNumber();
1049 }
1050 }
1051
1052 request->req_flags &= ~req_stall;
1053 request->req_operation = next_state;
1054
1055 try
1056 {
1057 looper_seh(tdbb, request, node);
1058 }
1059 catch (const Exception&)
1060 {
1061 // In the case of error, undo changes performed under our savepoint

Callers 3

EXE_receiveFunction · 0.85
EXE_sendFunction · 0.85
EXE_startFunction · 0.85

Calls 10

SET_TDBBFunction · 0.85
LCK_lockFunction · 0.85
looper_sehFunction · 0.85
moveToStackMethod · 0.80
getNumberMethod · 0.80
rollbackToSavepointMethod · 0.80
isChangingMethod · 0.80
getAttachmentMethod · 0.45
startSavepointMethod · 0.45
releaseSavepointMethod · 0.45

Tested by

no test coverage detected