public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: LIU Hao <lh_mouse@126.com>
To: Andrew Pinski <pinskia@gmail.com>
Cc: gcc@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: Re: why does gccgit require pthread?
Date: Mon, 7 Nov 2022 15:10:36 +0800	[thread overview]
Message-ID: <0c772b20-43f3-f89e-0feb-39a7cbce738b@126.com> (raw)
In-Reply-To: <CA+=Sn1=5WUBnpK6ER7YKkVwFBR_EKaEhEe0bq=8Y=AMyRZCakA@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1200 bytes --]

在 2022/11/7 15:03, Andrew Pinski 写道:
>>
>> The win32 thread model does not have `std::mutex`; but there is no `pthread_mutex_t` either, so it
>> does not build either way.
> Oh, but I would assume it will later on right?
> 

There has been effort on C++11 threading support for win32 thread model, but I have a negative 
attitude on that.

Another solution is to use `__gthread_mutex_t` instead of `pthread_mutex_t`, which is also available 
in the win32 thread model. Actually I prefer this approach as it keeps code structure like what we 
have at this moment.


> Also I think you might need to change some more than you did.
> That is:
> -#define INCLUDE_PTHREAD_H
>   #include "system.h"
> 
> You must likely have a macro, INCLUDE_MUTEX, and define that and
> include mutex in system.h like it was done for pthread.h.
> GCC loves to poison identifiers while lexing to make sure those
> identifiers are not used inside GCC and the include of mutex should be
> done early.
> 

Well I am not familiar with such behavior. Feel free to amend the patch, until it looks good to you. 
I hope we can check this in before GCC 13 RC.



-- 
Best regards,
LIU Hao


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

  reply	other threads:[~2022-11-07  7:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <8f15b063-9ec8-59e0-590b-20e416f68cb4@126.com>
     [not found] ` <CA+=Sn1ncp6hN8MnziZ+2f-6_UUqMwXeVGQLmft2NUeuXGOaBoA@mail.gmail.com>
2022-11-07  6:50   ` LIU Hao
2022-11-07  7:03     ` Andrew Pinski
2022-11-07  7:10       ` LIU Hao [this message]
2022-11-07 12:57     ` Jonathan Wakely
2022-11-07 13:33       ` LIU Hao
2022-11-07 13:51         ` Jonathan Wakely
2022-11-11 17:16           ` Jonathan Wakely
2022-11-11 18:27             ` Jonathan Wakely
2022-11-14 10:54               ` LIU Hao
2022-11-15 18:50             ` why does gcc jit " David Malcolm
2022-11-15 19:01               ` Jonathan Wakely
2022-11-19 11:27                 ` Jonathan Wakely
2022-11-19 12:51                   ` LIU Hao

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=0c772b20-43f3-f89e-0feb-39a7cbce738b@126.com \
    --to=lh_mouse@126.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gcc@gcc.gnu.org \
    --cc=pinskia@gmail.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).