Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
000b65fd
Commit
000b65fd
authored
Jul 30, 2013
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pg_upgrade: clarify C comment about Windows thread struct pointers
Backpatch to 9.3 to keep source trees consistent.
parent
69b7d59a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
contrib/pg_upgrade/parallel.c
contrib/pg_upgrade/parallel.c
+6
-6
No files found.
contrib/pg_upgrade/parallel.c
View file @
000b65fd
...
@@ -130,7 +130,7 @@ parallel_exec_prog(const char *log_file, const char *opt_log_file,
...
@@ -130,7 +130,7 @@ parallel_exec_prog(const char *log_file, const char *opt_log_file,
/* fork failed */
/* fork failed */
pg_log
(
PG_FATAL
,
"could not create worker process: %s
\n
"
,
strerror
(
errno
));
pg_log
(
PG_FATAL
,
"could not create worker process: %s
\n
"
,
strerror
(
errno
));
#else
#else
/*
use first empty array element
*/
/*
empty array element are always at the end
*/
new_arg
=
exec_thread_args
[
parallel_jobs
-
1
];
new_arg
=
exec_thread_args
[
parallel_jobs
-
1
];
/* Can only pass one pointer into the function, so use a struct */
/* 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,
...
@@ -244,7 +244,7 @@ parallel_transfer_all_new_dbs(DbInfoArr *old_db_arr, DbInfoArr *new_db_arr,
/* fork failed */
/* fork failed */
pg_log
(
PG_FATAL
,
"could not create worker process: %s
\n
"
,
strerror
(
errno
));
pg_log
(
PG_FATAL
,
"could not create worker process: %s
\n
"
,
strerror
(
errno
));
#else
#else
/*
use first empty array element
*/
/*
empty array element are always at the end
*/
new_arg
=
transfer_thread_args
[
parallel_jobs
-
1
];
new_arg
=
transfer_thread_args
[
parallel_jobs
-
1
];
/* Can only pass one pointer into the function, so use a struct */
/* Can only pass one pointer into the function, so use a struct */
...
@@ -339,10 +339,10 @@ reap_child(bool wait_for_child)
...
@@ -339,10 +339,10 @@ reap_child(bool wait_for_child)
thread_handles
[
thread_num
]
=
thread_handles
[
parallel_jobs
-
1
];
thread_handles
[
thread_num
]
=
thread_handles
[
parallel_jobs
-
1
];
/*
/*
*
We must swap the arg struct pointers because the thread we just
*
Move last active thead arg struct into the now-dead slot,
*
moved is active, and we must make sure it is not reused by the next
*
and the now-dead slot to the end for reuse by the next thread.
*
created thread. Instead, the new thread will use the arg struct of
*
Though the thread struct is in use by another thread, we can
*
the thread that just died
.
*
safely swap the struct pointers within the array
.
*/
*/
tmp_args
=
cur_thread_args
[
thread_num
];
tmp_args
=
cur_thread_args
[
thread_num
];
cur_thread_args
[
thread_num
]
=
cur_thread_args
[
parallel_jobs
-
1
];
cur_thread_args
[
thread_num
]
=
cur_thread_args
[
parallel_jobs
-
1
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment