This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Re: Re: Adding a new thread model to GCC
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: lh_mouse <lh_mouse at 126 dot com>
- Cc: gcc <gcc at gcc dot gnu dot org>, mingw-w64-public <mingw-w64-public at lists dot sourceforge dot net>
- Date: Mon, 18 Apr 2016 10:59:08 +0100
- Subject: Re: Re: Re: Adding a new thread model to GCC
- Authentication-results: sourceware.org; auth=none
- References: <2f3897eb dot bbc0e dot 1540ee9aa0b dot Coremail dot lh_mouse at 126 dot com> <CAH6eHdQ2b_NLLC6Hyq=tKgXhgAEhTdV1d2+sv6enHN7wG4JESQ at mail dot gmail dot com> <3eafd9c2 dot ce5a2 dot 154252730a4 dot Coremail dot lh_mouse at 126 dot com> <CAH6eHdQhDSwSt91xSi_yGSrsownGCErTP5H=3w1NrjXkr9T98Q at mail dot gmail dot com> <3d4feb73 dot d4007 dot 15428a9a070 dot Coremail dot lh_mouse at 126 dot com> <CAH6eHdTz9HBJEgJqSse9QDJqs5KpUpVWi8FXScSVCL4-=kh9mg at mail dot gmail dot com>
On 18 April 2016 at 10:57, Jonathan Wakely wrote:
> On 18 April 2016 at 10:18, lh_mouse wrote:
>>> I don't see why it has to be a struct, it just has to be suitable as
>>> an argument to the relevant __gthread functions.
>>
>> The type __gthread_time_t is referenced in gcc/libstdc++-v3/include/std/mutex:157
>> __gthread_time_t __ts = {
>> static_cast<std::time_t>(__s.time_since_epoch().count()),
>> static_cast<long>(__ns.count())
>> };
>> This definition uses a braced-init-list that has two elements and is unsuitable for scalar types.
>
> Yes I know.
>
> What I meant is that there's no fundamental reason it needs to be a
> struct. That code could be changed.
However, that code in <mutex> is only needed for timed mutexes, and I
thought you said that wouldn't be supported.
There is code using __gthread_time_t in <condition_variable> that
needs to work even if timed mutexes are not supported.