|
36 | 36 | gettimeofday(&start_t, NULL); \
|
37 | 37 | } while (0)
|
38 | 38 | #else
|
| 39 | +/* WIN32 doesn't support alarm, so we create a thread and sleep there */ |
39 | 40 | #defineSTART_TIMER\
|
40 | 41 | do { \
|
41 | 42 | alarm_triggered = false; \
|
@@ -76,7 +77,11 @@ static void test_sync(int writes_per_op);
|
76 | 77 | staticvoidtest_open_syncs(void);
|
77 | 78 | staticvoidtest_open_sync(constchar*msg,intwrites_size);
|
78 | 79 | staticvoidtest_file_descriptor_sync(void);
|
| 80 | +#ifndefWIN32 |
79 | 81 | staticvoidprocess_alarm(intsig);
|
| 82 | +#else |
| 83 | +staticDWORDWINAPIprocess_alarm(LPVOIDparam); |
| 84 | +#endif |
80 | 85 | staticvoidsignal_cleanup(intsig);
|
81 | 86 |
|
82 | 87 | #ifdefHAVE_FSYNC_WRITETHROUGH
|
@@ -566,17 +571,22 @@ print_elapse(struct timeval start_t, struct timeval stop_t, int ops)
|
566 | 571 | printf(OPS_FORMAT"\n",per_second);
|
567 | 572 | }
|
568 | 573 |
|
| 574 | +#ifndefWIN32 |
569 | 575 | staticvoid
|
570 | 576 | process_alarm(intsig)
|
571 | 577 | {
|
572 |
| -#ifdefWIN32 |
573 |
| -sleep(secs_per_test); |
574 |
| -#endif |
575 | 578 | 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; |
577 | 587 | ExitThread(0);
|
578 |
| -#endif |
579 | 588 | }
|
| 589 | +#endif |
580 | 590 |
|
581 | 591 | staticvoid
|
582 | 592 | die(constchar*str)
|
|