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
000b65fd
Commit
000b65fd
authored
11 years ago
by
Bruce Momjian
Browse files
Options
Downloads
Patches
Plain Diff
pg_upgrade: clarify C comment about Windows thread struct pointers
Backpatch to 9.3 to keep source trees consistent.
parent
69b7d59a
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
contrib/pg_upgrade/parallel.c
+6
-6
6 additions, 6 deletions
contrib/pg_upgrade/parallel.c
with
6 additions
and
6 deletions
contrib/pg_upgrade/parallel.c
+
6
−
6
View file @
000b65fd
...
...
@@ -130,7 +130,7 @@ parallel_exec_prog(const char *log_file, const char *opt_log_file,
/* fork failed */
pg_log
(
PG_FATAL
,
"could not create worker process: %s
\n
"
,
strerror
(
errno
));
#else
/*
use first
empty array element */
/* empty array element
are always at the end
*/
new_arg
=
exec_thread_args
[
parallel_jobs
-
1
];
/* Can only pass one pointer into the function, so use a struct */
...
...
@@ -244,7 +244,7 @@ parallel_transfer_all_new_dbs(DbInfoArr *old_db_arr, DbInfoArr *new_db_arr,
/* fork failed */
pg_log
(
PG_FATAL
,
"could not create worker process: %s
\n
"
,
strerror
(
errno
));
#else
/*
use first
empty array element */
/* empty array element
are always at the end
*/
new_arg
=
transfer_thread_args
[
parallel_jobs
-
1
];
/* Can only pass one pointer into the function, so use a struct */
...
...
@@ -339,10 +339,10 @@ reap_child(bool wait_for_child)
thread_handles
[
thread_num
]
=
thread_handles
[
parallel_jobs
-
1
];
/*
*
We must swap
the arg struct
po
int
ers because the thread we just
*
moved is active, and we must make sure it is not
reuse
d
by the next
*
created thread. Instead, the new thread will use the arg struct of
*
the thread that just died
.
*
Move last active
the
ad
arg struct int
o the now-dead slot,
*
and the now-dead slot to the end for
reuse by the next
thread.
*
Though the thread struct is in use by another thread, we can
*
safely swap the struct pointers within the array
.
*/
tmp_args
=
cur_thread_args
[
thread_num
];
cur_thread_args
[
thread_num
]
=
cur_thread_args
[
parallel_jobs
-
1
];
...
...
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