88{
89 sigjmp_buf local_sigjmp_buf;
91 int left_till_hibernate;
92 bool hibernating;
93
94 Assert(startup_data_len == 0);
95
98
99
100
101
102
103
104
108
113
114
115
116
118
119
120
121
122
123
124
126 "Wal Writer",
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148 if (sigsetjmp(local_sigjmp_buf, 1) != 0)
149 {
150
152
153
155
156
158
159
160
161
162
163
173
174
175
176
177
180
181
183
184
186
187
188
189
190
191
193 }
194
195
197
198
199
200
202
203
204
205
207 hibernating = false;
209
210
211
212
213
215
216
217
218
219 for (;;)
220 {
221 long cur_timeout;
222
223
224
225
226
227
228
229
230
231
232 if (hibernating != (left_till_hibernate <= 1))
233 {
234 hibernating = (left_till_hibernate <= 1);
236 }
237
238
240
241
243
244
245
246
247
250 else if (left_till_hibernate > 0)
251 left_till_hibernate--;
252
253
255
256
257
258
259
260
261 if (left_till_hibernate > 0)
263 else
265
268 cur_timeout,
269 WAIT_EVENT_WAL_WRITER_MAIN);
270 }
271}
void AuxiliaryProcessMainCommon(void)
void AtEOXact_Buffers(bool isCommit)
#define Assert(condition)
bool ConditionVariableCancelSleep(void)
void AtEOXact_HashTables(bool isCommit)
void EmitErrorReport(void)
ErrorContextCallback * error_context_stack
void FlushErrorState(void)
sigjmp_buf * PG_exception_stack
void AtEOXact_Files(bool isCommit)
void SignalHandlerForShutdownRequest(SIGNAL_ARGS)
void SignalHandlerForConfigReload(SIGNAL_ARGS)
void HandleMainLoopInterrupts(void)
void ResetLatch(Latch *latch)
int WaitLatch(Latch *latch, int wakeEvents, long timeout, uint32 wait_event_info)
#define WL_EXIT_ON_PM_DEATH
void LWLockReleaseAll(void)
void MemoryContextReset(MemoryContext context)
MemoryContext TopMemoryContext
#define AllocSetContextCreate
#define ALLOCSET_DEFAULT_SIZES
#define RESUME_INTERRUPTS()
#define HOLD_INTERRUPTS()
BackendType MyBackendType
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
void pgstat_report_wal(bool force)
void procsignal_sigusr1_handler(SIGNAL_ARGS)
void ReleaseAuxProcessResources(bool isCommit)
void pg_usleep(long microsec)
static void pgstat_report_wait_end(void)
#define LOOPS_UNTIL_HIBERNATE
void SetWalWriterSleeping(bool sleeping)
bool XLogBackgroundFlush(void)