Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
388c2f93
Commit
388c2f93
authored
13 years ago
by
Bruce Momjian
Browse files
Options
Downloads
Patches
Plain Diff
Fix pg_test_fsync Win32 problems reported by the build farm; add
comments about the alarm method used on Win32.
parent
7ae2db1d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
contrib/pg_test_fsync/pg_test_fsync.c
+15
-5
15 additions, 5 deletions
contrib/pg_test_fsync/pg_test_fsync.c
with
15 additions
and
5 deletions
contrib/pg_test_fsync/pg_test_fsync.c
+
15
−
5
View file @
388c2f93
...
...
@@ -36,6 +36,7 @@ do { \
gettimeofday(&start_t, NULL); \
} while (0)
#else
/* WIN32 doesn't support alarm, so we create a thread and sleep there */
#define START_TIMER \
do { \
alarm_triggered = false; \
...
...
@@ -76,7 +77,11 @@ static void test_sync(int writes_per_op);
static
void
test_open_syncs
(
void
);
static
void
test_open_sync
(
const
char
*
msg
,
int
writes_size
);
static
void
test_file_descriptor_sync
(
void
);
#ifndef WIN32
static
void
process_alarm
(
int
sig
);
#else
static
DWORD
WINAPI
process_alarm
(
LPVOID
param
);
#endif
static
void
signal_cleanup
(
int
sig
);
#ifdef HAVE_FSYNC_WRITETHROUGH
...
...
@@ -566,17 +571,22 @@ print_elapse(struct timeval start_t, struct timeval stop_t, int ops)
printf
(
OPS_FORMAT
"
\n
"
,
per_second
);
}
#ifndef WIN32
static
void
process_alarm
(
int
sig
)
{
#ifdef WIN32
sleep
(
secs_per_test
);
#endif
alarm_triggered
=
true
;
#ifdef WIN32
}
#else
static
DWORD
WINAPI
process_alarm
(
LPVOID
param
)
{
/* WIN32 doesn't support alarm, so we create a thread and sleep here */
Sleep
(
secs_per_test
*
1000
);
alarm_triggered
=
true
;
ExitThread
(
0
);
#endif
}
#endif
static
void
die
(
const
char
*
str
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment