Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitab9ed9b

Browse files
committed
Assert that pgwin32_signal_initialize() has been called early enough.
Before the pgwin32_signal_initialize() call, the backend version ofpg_usleep() has no effect. No in-tree code falls afoul of that today,but temporary commit2307868 did so.Discussion:https://postgr.es/m/20190402135442.GA1173872@rfd.leadboat.com
1 parentf433394 commitab9ed9b

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

‎src/backend/port/win32/signal.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ static BOOL WINAPI pg_console_handler(DWORD dwCtrlType);
5252
void
5353
pg_usleep(longmicrosec)
5454
{
55+
Assert(pgwin32_signal_event!=NULL);
5556
if (WaitForSingleObject(pgwin32_signal_event,
5657
(microsec<500 ?1 : (microsec+500) /1000))
5758
==WAIT_OBJECT_0)
@@ -108,6 +109,7 @@ pgwin32_dispatch_queued_signals(void)
108109
{
109110
intexec_mask;
110111

112+
Assert(pgwin32_signal_event!=NULL);
111113
EnterCriticalSection(&pg_signal_crit_sec);
112114
while ((exec_mask=UNBLOCKED_SIGNAL_QUEUE())!=0)
113115
{
@@ -209,6 +211,7 @@ pgwin32_create_signal_listener(pid_t pid)
209211
void
210212
pg_queue_signal(intsignum)
211213
{
214+
Assert(pgwin32_signal_event!=NULL);
212215
if (signum >=PG_SIGNAL_COUNT||signum <=0)
213216
return;
214217

‎src/port/open.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ pgwin32_open(const char *fileName, int fileFlags,...)
7070
(O_RANDOM |O_SEQUENTIAL |O_TEMPORARY) |
7171
_O_SHORT_LIVED |O_DSYNC |O_DIRECT |
7272
(O_CREAT |O_TRUNC |O_EXCL) | (O_TEXT |O_BINARY)))==fileFlags);
73+
#ifndefFRONTEND
74+
Assert(pgwin32_signal_event!=NULL);/* small chance of pg_usleep() */
75+
#endif
7376

7477
#ifdefFRONTEND
7578

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp