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

Function SHUT_blocking_ast

src/jrd/shut.cpp:80–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78
79
80bool SHUT_blocking_ast(thread_db* tdbb, bool ast)
81{
82/**************************************
83 *
84 * S H U T _ b l o c k i n g _ a s t
85 *
86 **************************************
87 *
88 * Functional description
89 * Read data from database lock for
90 * shutdown instructions.
91 *
92 **************************************/
93 SET_TDBB(tdbb);
94 Database* const dbb = tdbb->getDatabase();
95
96 shutdown_data data;
97 data.data_long = LCK_read_data(tdbb, dbb->dbb_lock);
98 const SSHORT flag = data.data_items.flag;
99 const SSHORT delay = data.data_items.delay;
100
101 const int shut_mode = flag & isc_dpb_shut_mode_mask;
102
103 // Delay of -1 means we're going online
104
105 if (delay == -1)
106 {
107 dbb->dbb_ast_flags &= ~(DBB_shut_attach | DBB_shut_tran | DBB_shut_force);
108
109 if (shut_mode)
110 {
111 dbb->dbb_ast_flags &= ~(DBB_shutdown | DBB_shutdown_single | DBB_shutdown_full);
112
113 switch (shut_mode)
114 {
115 case isc_dpb_shut_normal:
116 break;
117 case isc_dpb_shut_multi:
118 dbb->dbb_ast_flags |= DBB_shutdown;
119 break;
120 case isc_dpb_shut_single:
121 dbb->dbb_ast_flags |= DBB_shutdown | DBB_shutdown_single;
122 break;
123 case isc_dpb_shut_full:
124 dbb->dbb_ast_flags |= DBB_shutdown | DBB_shutdown_full;
125 break;
126 default:
127 fb_assert(false);
128 }
129 }
130
131 return false;
132 }
133
134 if (flag & SHUT_flag_restoring)
135 dbb->setRestoring(true);
136
137 if ((flag & isc_dpb_shut_force) && !delay)

Callers 3

CCH_down_grade_dbbFunction · 0.85
SHUT_initFunction · 0.85
notify_shutdownFunction · 0.85

Calls 5

SET_TDBBFunction · 0.85
LCK_read_dataFunction · 0.85
shutdownFunction · 0.85
getDatabaseMethod · 0.80
setRestoringMethod · 0.80

Tested by

no test coverage detected