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

Commit000b65f

Browse files
committed
pg_upgrade: clarify C comment about Windows thread struct pointers
Backpatch to 9.3 to keep source trees consistent.
1 parent69b7d59 commit000b65f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

‎contrib/pg_upgrade/parallel.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ parallel_exec_prog(const char *log_file, const char *opt_log_file,
130130
/* fork failed */
131131
pg_log(PG_FATAL,"could not create worker process: %s\n",strerror(errno));
132132
#else
133-
/*use firstempty array element */
133+
/* empty array element are always at the end */
134134
new_arg=exec_thread_args[parallel_jobs-1];
135135

136136
/* 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,
244244
/* fork failed */
245245
pg_log(PG_FATAL,"could not create worker process: %s\n",strerror(errno));
246246
#else
247-
/*use firstempty array element */
247+
/* empty array element are always at the end */
248248
new_arg=transfer_thread_args[parallel_jobs-1];
249249

250250
/* Can only pass one pointer into the function, so use a struct */
@@ -339,10 +339,10 @@ reap_child(bool wait_for_child)
339339
thread_handles[thread_num]=thread_handles[parallel_jobs-1];
340340

341341
/*
342-
*We must swap the arg structpointers becausethethread we just
343-
*moved is active,andwe must make sure it is not reused by the next
344-
*created thread.Instead,thenewthreadwillusethe arg struct of
345-
* thethread that just died.
342+
*Move last active thead arg structintothenow-dead slot,
343+
* andthe now-dead slot to the end for reuse by the next thread.
344+
*Thoughthe threadstruct is inuseby another thread, we can
345+
*safely swapthestruct pointers within the array.
346346
*/
347347
tmp_args=cur_thread_args[thread_num];
348348
cur_thread_args[thread_num]=cur_thread_args[parallel_jobs-1];

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp