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

Commit388c2f9

Browse files
committed
Fix pg_test_fsync Win32 problems reported by the build farm; add
comments about the alarm method used on Win32.
1 parent7ae2db1 commit388c2f9

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

‎contrib/pg_test_fsync/pg_test_fsync.c

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ do { \
3636
gettimeofday(&start_t, NULL); \
3737
} while (0)
3838
#else
39+
/* WIN32 doesn't support alarm, so we create a thread and sleep there */
3940
#defineSTART_TIMER\
4041
do { \
4142
alarm_triggered = false; \
@@ -76,7 +77,11 @@ static void test_sync(int writes_per_op);
7677
staticvoidtest_open_syncs(void);
7778
staticvoidtest_open_sync(constchar*msg,intwrites_size);
7879
staticvoidtest_file_descriptor_sync(void);
80+
#ifndefWIN32
7981
staticvoidprocess_alarm(intsig);
82+
#else
83+
staticDWORDWINAPIprocess_alarm(LPVOIDparam);
84+
#endif
8085
staticvoidsignal_cleanup(intsig);
8186

8287
#ifdefHAVE_FSYNC_WRITETHROUGH
@@ -566,17 +571,22 @@ print_elapse(struct timeval start_t, struct timeval stop_t, int ops)
566571
printf(OPS_FORMAT"\n",per_second);
567572
}
568573

574+
#ifndefWIN32
569575
staticvoid
570576
process_alarm(intsig)
571577
{
572-
#ifdefWIN32
573-
sleep(secs_per_test);
574-
#endif
575578
alarm_triggered= true;
576-
#ifdefWIN32
579+
}
580+
#else
581+
staticDWORDWINAPI
582+
process_alarm(LPVOIDparam)
583+
{
584+
/* WIN32 doesn't support alarm, so we create a thread and sleep here */
585+
Sleep(secs_per_test*1000);
586+
alarm_triggered= true;
577587
ExitThread(0);
578-
#endif
579588
}
589+
#endif
580590

581591
staticvoid
582592
die(constchar*str)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp