git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Seija Kijin via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"Johannes Sixt" <j6t@kdbg.org>, "René Scharfe" <l.s.r@web.de>,
	"Seija Kijin" <doremylover123@gmail.com>
Subject: Re: [PATCH v12 1/2] win32-pthread: prepare pthread.c for change by formatting
Date: Mon, 26 Dec 2022 10:32:53 +0900	[thread overview]
Message-ID: <xmqqmt7blzju.fsf@gitster.g> (raw)
In-Reply-To: <e0cc43efc6c498706559ae4fc71c597a6481f64c.1671932405.git.gitgitgadget@gmail.com> (Seija Kijin via GitGitGadget's message of "Sun, 25 Dec 2022 01:40:04 +0000")

"Seija Kijin via GitGitGadget" <gitgitgadget@gmail.com> writes:

>  int pthread_create(pthread_t *thread, const void *unused,
> -		   void *(*start_routine)(void*), void *arg)
> +		   void *(*start_routine)(void *), void *arg)

Good.

>  {
>  	thread->arg = arg;
>  	thread->start_routine = start_routine;
> -	thread->handle = (HANDLE)
> -		_beginthreadex(NULL, 0, win32_start_routine, thread, 0, NULL);
> +	thread->handle = (HANDLE)_beginthreadex(NULL, 0, win32_start_routine,
> +						thread, 0, NULL);

I would say this is good either way---preimage may slightly be
easier to read, but it is not worth a patch churn.

> -	DWORD result = WaitForSingleObject(thread->handle, INFINITE);
> -	switch (result) {
> -		case WAIT_OBJECT_0:
> -			if (value_ptr)
> -				*value_ptr = thread->arg;
> -			return 0;
> -		case WAIT_ABANDONED:
> -			return EINVAL;
> -		default:
> -			return err_win_to_posix(GetLastError());
> +	switch (WaitForSingleObject(thread->handle, INFINITE)) {
> +	case WAIT_OBJECT_0:
> +		if (value_ptr)
> +			*value_ptr = thread->arg;
> +		return 0;
> +	case WAIT_ABANDONED:
> +		return EINVAL;
> +	default:
> +		return err_win_to_posix(GetLastError());
>  	}
>  }

Loss of a single-use variable is, strictly speaking, a "while at it"
change that has nothing to do with "reformatting", but otherwise the
result of the hunk looks good.

Will queue.

Thanks.



P.S.  An address that is designed to bounce or sent to black hole
appears on the CC: of the original e-mail message.  Can you stop
doing that (or is that what GGG does without user's control)?

  Rose <83477269+AtariDreams@users.noreply.github.com>

  reply	other threads:[~2022-12-26  1:41 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-19 18:34 [PATCH] win32: close handles of threads that have been joined Rose via GitGitGadget
2022-12-19 18:40 ` Ævar Arnfjörð Bjarmason
2022-12-20  7:53 ` Johannes Sixt
2022-12-20 18:57 ` [PATCH v2] " Rose via GitGitGadget
2022-12-20 19:00   ` [PATCH v3] " Rose via GitGitGadget
2022-12-20 20:03     ` [PATCH v4 0/2] " Rose via GitGitGadget
2022-12-20 20:04       ` [PATCH v4 1/2] " Seija Kijin via GitGitGadget
2022-12-20 20:04       ` [PATCH v4 2/2] prep Seija Kijin via GitGitGadget
2022-12-20 21:18       ` [PATCH v5] win32: close handles of threads that have been joined Rose via GitGitGadget
2022-12-20 22:06         ` Johannes Sixt
2022-12-21  4:35         ` [PATCH v6 0/2] " Rose via GitGitGadget
2022-12-21  4:35           ` [PATCH v6 1/2] " Seija Kijin via GitGitGadget
2022-12-21  4:35           ` [PATCH v6 2/2] prep Seija Kijin via GitGitGadget
2022-12-21  4:46           ` [PATCH v7 0/2] win32: close handles of threads that have been joined Rose via GitGitGadget
2022-12-21  4:46             ` [PATCH v7 1/2] " Seija Kijin via GitGitGadget
2022-12-22  7:52               ` Johannes Sixt
2022-12-21  4:46             ` [PATCH v7 2/2] prep Seija Kijin via GitGitGadget
2022-12-22 16:01             ` [PATCH v8] win32: close handles of threads that have been joined Rose via GitGitGadget
2022-12-22 17:17               ` [PATCH v9 0/2] " Rose via GitGitGadget
2022-12-22 17:17                 ` [PATCH v9 1/2] " Seija Kijin via GitGitGadget
2022-12-22 17:17                 ` [PATCH v9 2/2] prep: reformat pthread.c to fit coding guidelines Seija Kijin via GitGitGadget
2022-12-23  1:51                   ` Junio C Hamano
2022-12-23 19:15                 ` [PATCH v10 0/2] win32: close handles of threads that have been joined Rose via GitGitGadget
2022-12-23 19:15                   ` [PATCH v10 1/2] win32-pthread: prepare pthread.c for change by formatting Seija Kijin via GitGitGadget
2022-12-23 19:15                   ` [PATCH v10 2/2] win32: close handles of threads that have been joined Seija Kijin via GitGitGadget
2022-12-23 19:19                   ` [PATCH v11 0/2] " Rose via GitGitGadget
2022-12-23 19:19                     ` [PATCH v11 1/2] win32-pthread: prepare pthread.c for change by formatting Seija Kijin via GitGitGadget
2022-12-23 19:19                     ` [PATCH v11 2/2] win32: close handles of threads that have been joined Seija Kijin via GitGitGadget
2022-12-24  7:50                       ` René Scharfe
2022-12-25  1:40                     ` [PATCH v12 0/2] " Rose via GitGitGadget
2022-12-25  1:40                       ` [PATCH v12 1/2] win32-pthread: prepare pthread.c for change by formatting Seija Kijin via GitGitGadget
2022-12-26  1:32                         ` Junio C Hamano [this message]
2022-12-25  1:40                       ` [PATCH v12 2/2] win32: close handles of threads that have been joined Seija Kijin via GitGitGadget
2022-12-26  2:07                         ` Junio C Hamano
2023-01-03 16:20                       ` [PATCH v13 0/2] " Rose via GitGitGadget
2023-01-03 16:20                         ` [PATCH v13 1/2] win32: prepare pthread.c for change by formatting Seija Kijin via GitGitGadget
2023-01-03 16:20                         ` [PATCH v13 2/2] win32: close handles of threads that have been joined Seija Kijin via GitGitGadget
2023-01-05 15:44                         ` [PATCH v14 0/2] " Rose via GitGitGadget
2023-01-05 15:44                           ` [PATCH v14 1/2] win32: prepare pthread.c for change by formatting Seija Kijin via GitGitGadget
2023-01-05 15:44                           ` [PATCH v14 2/2] win32: close handles of threads that have been joined Seija Kijin via GitGitGadget
2023-01-06 12:28                           ` [PATCH v14 0/2] " Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqmt7blzju.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=avarab@gmail.com \
    --cc=doremylover123@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=j6t@kdbg.org \
    --cc=l.s.r@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).