unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] nptl: Add POSIX-proposed _clock functions to hppa pthread.h
@ 2019-07-17  8:43 Mike Crowe
  2019-07-17  8:47 ` Florian Weimer
  0 siblings, 1 reply; 6+ messages in thread
From: Mike Crowe @ 2019-07-17  8:43 UTC (permalink / raw)
  To: libc-alpha, Florian Weimer, Adhemerval Zanella,
	Carlos O'Donell
  Cc: Mike Crowe

The pthread _clock functions that were recently added to nptl need to be
declared in hppa's pthread.h too. After this change, the function
declaration part of sysdeps/nptl/pthread.h and
sysdeps/unix/sysv/linux/hppa/pthread.h are identical.

	* sysdeps/unix/sysv/linux/hppa/pthread.h: Add declarations of
	functions recently added to sysdeps/nptl/pthread.h:
	pthread_mutex_clocklock, pthread_rwlock_clockrdlock,
	pthread_rwlock_clockwrlock and pthread_cond_clockwait.
---
 ChangeLog                              |  7 +++++
 sysdeps/unix/sysv/linux/hppa/pthread.h | 36 ++++++++++++++++++++++++++
 2 files changed, 43 insertions(+)

I ran "build-many-glibcs.py [..] glibcs hppa-linux-gnu" successfully
after this change, but that's all. I've been unable to find an hppa
machine on the GCC farm. :(

diff --git a/ChangeLog b/ChangeLog
index 3d884f2925..c2e3be57d2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2019-07-17  Mike Crowe  <mac@mcrowe.com>
+
+	* sysdeps/unix/sysv/linux/hppa/pthread.h: Add declarations of
+	functions recently added to sysdeps/nptl/pthread.h:
+	pthread_mutex_clocklock, pthread_rwlock_clockrdlock,
+	pthread_rwlock_clockwrlock and pthread_cond_clockwait.
+
 2019-07-16  Mike Crowe  <mac@mcrowe.com>
 
 	* nptl/forward.c: Remove unnecessary __pthread_cond_clockwait and
diff --git a/sysdeps/unix/sysv/linux/hppa/pthread.h b/sysdeps/unix/sysv/linux/hppa/pthread.h
index 45e706c037..5a1c641515 100644
--- a/sysdeps/unix/sysv/linux/hppa/pthread.h
+++ b/sysdeps/unix/sysv/linux/hppa/pthread.h
@@ -746,6 +746,13 @@ extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex,
 				    __abstime) __THROWNL __nonnull ((1, 2));
 #endif
 
+#ifdef __USE_GNU
+extern int pthread_mutex_clocklock (pthread_mutex_t *__restrict __mutex,
+				    clockid_t __clockid,
+				    const struct timespec *__restrict
+				    __abstime) __THROWNL __nonnull ((1, 3));
+#endif
+
 /* Unlock a mutex.  */
 extern int pthread_mutex_unlock (pthread_mutex_t *__mutex)
      __THROWNL __nonnull ((1));
@@ -885,6 +892,13 @@ extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock,
 				       __abstime) __THROWNL __nonnull ((1, 2));
 # endif
 
+# ifdef __USE_GNU
+extern int pthread_rwlock_clockrdlock (pthread_rwlock_t *__restrict __rwlock,
+				       clockid_t __clockid,
+				       const struct timespec *__restrict
+				       __abstime) __THROWNL __nonnull ((1, 3));
+# endif
+
 /* Acquire write lock for RWLOCK.  */
 extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock)
      __THROWNL __nonnull ((1));
@@ -900,6 +914,13 @@ extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock,
 				       __abstime) __THROWNL __nonnull ((1, 2));
 # endif
 
+# ifdef __USE_GNU
+extern int pthread_rwlock_clockwrlock (pthread_rwlock_t *__restrict __rwlock,
+				       clockid_t __clockid,
+				       const struct timespec *__restrict
+				       __abstime) __THROWNL __nonnull ((1, 3));
+# endif
+
 /* Unlock RWLOCK.  */
 extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock)
      __THROWNL __nonnull ((1));
@@ -979,6 +1000,21 @@ extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond,
 				   const struct timespec *__restrict __abstime)
      __nonnull ((1, 2, 3));
 
+# ifdef __USE_GNU
+/* Wait for condition variable COND to be signaled or broadcast until
+   ABSTIME measured by the specified clock. MUTEX is assumed to be
+   locked before. CLOCK is the clock to use. ABSTIME is an absolute
+   time specification against CLOCK's epoch.
+
+   This function is a cancellation point and therefore not marked with
+   __THROW. */
+extern int pthread_cond_clockwait (pthread_cond_t *__restrict __cond,
+				   pthread_mutex_t *__restrict __mutex,
+				   __clockid_t __clock_id,
+				   const struct timespec *__restrict __abstime)
+     __nonnull ((1, 2, 4));
+# endif
+
 /* Functions for handling condition variable attributes.  */
 
 /* Initialize condition variable attribute ATTR.  */
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] nptl: Add POSIX-proposed _clock functions to hppa pthread.h
  2019-07-17  8:43 [PATCH] nptl: Add POSIX-proposed _clock functions to hppa pthread.h Mike Crowe
@ 2019-07-17  8:47 ` Florian Weimer
  2019-07-17  8:58   ` Mike Crowe
  0 siblings, 1 reply; 6+ messages in thread
From: Florian Weimer @ 2019-07-17  8:47 UTC (permalink / raw)
  To: Mike Crowe; +Cc: libc-alpha, Adhemerval Zanella, Carlos O'Donell

* Mike Crowe:

> diff --git a/ChangeLog b/ChangeLog
> index 3d884f2925..c2e3be57d2 100644
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,3 +1,10 @@
> +2019-07-17  Mike Crowe  <mac@mcrowe.com>
> +
> +	* sysdeps/unix/sysv/linux/hppa/pthread.h: Add declarations of
> +	functions recently added to sysdeps/nptl/pthread.h:
> +	pthread_mutex_clocklock, pthread_rwlock_clockrdlock,
> +	pthread_rwlock_clockwrlock and pthread_cond_clockwait.
> +

Can you rebase this on current master?  The index hash does not seem to
be valid outside your tree.

Thanks,
Florian

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] nptl: Add POSIX-proposed _clock functions to hppa pthread.h
  2019-07-17  8:47 ` Florian Weimer
@ 2019-07-17  8:58   ` Mike Crowe
  2019-07-17 12:44     ` Florian Weimer
  0 siblings, 1 reply; 6+ messages in thread
From: Mike Crowe @ 2019-07-17  8:58 UTC (permalink / raw)
  To: Florian Weimer
  Cc: Mike Crowe, libc-alpha, Adhemerval Zanella, Carlos O'Donell

On Wednesday 17 July 2019 at 10:47:26 +0200, Florian Weimer wrote:
> * Mike Crowe:
> 
> > diff --git a/ChangeLog b/ChangeLog
> > index 3d884f2925..c2e3be57d2 100644
> > --- a/ChangeLog
> > +++ b/ChangeLog
> > @@ -1,3 +1,10 @@
> > +2019-07-17  Mike Crowe  <mac@mcrowe.com>
> > +
> > +	* sysdeps/unix/sysv/linux/hppa/pthread.h: Add declarations of
> > +	functions recently added to sysdeps/nptl/pthread.h:
> > +	pthread_mutex_clocklock, pthread_rwlock_clockrdlock,
> > +	pthread_rwlock_clockwrlock and pthread_cond_clockwait.
> > +
> 
> Can you rebase this on current master?  The index hash does not seem to
> be valid outside your tree.

It's on top of https://sourceware.org/ml/libc-alpha/2019-07/msg00298.html

Shall I swap them over and repost both?

Thanks.

Mike.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] nptl: Add POSIX-proposed _clock functions to hppa pthread.h
  2019-07-17  8:58   ` Mike Crowe
@ 2019-07-17 12:44     ` Florian Weimer
  2019-07-17 17:00       ` Adhemerval Zanella
  0 siblings, 1 reply; 6+ messages in thread
From: Florian Weimer @ 2019-07-17 12:44 UTC (permalink / raw)
  To: Mike Crowe; +Cc: libc-alpha, Adhemerval Zanella, Carlos O'Donell

* Mike Crowe:

> On Wednesday 17 July 2019 at 10:47:26 +0200, Florian Weimer wrote:
>> * Mike Crowe:
>> 
>> > diff --git a/ChangeLog b/ChangeLog
>> > index 3d884f2925..c2e3be57d2 100644
>> > --- a/ChangeLog
>> > +++ b/ChangeLog
>> > @@ -1,3 +1,10 @@
>> > +2019-07-17  Mike Crowe  <mac@mcrowe.com>
>> > +
>> > +	* sysdeps/unix/sysv/linux/hppa/pthread.h: Add declarations of
>> > +	functions recently added to sysdeps/nptl/pthread.h:
>> > +	pthread_mutex_clocklock, pthread_rwlock_clockrdlock,
>> > +	pthread_rwlock_clockwrlock and pthread_cond_clockwait.
>> > +
>> 
>> Can you rebase this on current master?  The index hash does not seem to
>> be valid outside your tree.
>
> It's on top of https://sourceware.org/ml/libc-alpha/2019-07/msg00298.html
>
> Shall I swap them over and repost both?

Ah, no need for that then.

I verified that this fixes the hppa build issue.

Thanks,
Florian

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] nptl: Add POSIX-proposed _clock functions to hppa pthread.h
  2019-07-17 12:44     ` Florian Weimer
@ 2019-07-17 17:00       ` Adhemerval Zanella
  2019-07-18 17:39         ` Carlos O'Donell
  0 siblings, 1 reply; 6+ messages in thread
From: Adhemerval Zanella @ 2019-07-17 17:00 UTC (permalink / raw)
  To: Florian Weimer, Mike Crowe; +Cc: libc-alpha, Carlos O'Donell



On 17/07/2019 09:44, Florian Weimer wrote:
> * Mike Crowe:
> 
>> On Wednesday 17 July 2019 at 10:47:26 +0200, Florian Weimer wrote:
>>> * Mike Crowe:
>>>
>>>> diff --git a/ChangeLog b/ChangeLog
>>>> index 3d884f2925..c2e3be57d2 100644
>>>> --- a/ChangeLog
>>>> +++ b/ChangeLog
>>>> @@ -1,3 +1,10 @@
>>>> +2019-07-17  Mike Crowe  <mac@mcrowe.com>
>>>> +
>>>> +	* sysdeps/unix/sysv/linux/hppa/pthread.h: Add declarations of
>>>> +	functions recently added to sysdeps/nptl/pthread.h:
>>>> +	pthread_mutex_clocklock, pthread_rwlock_clockrdlock,
>>>> +	pthread_rwlock_clockwrlock and pthread_cond_clockwait.
>>>> +
>>>
>>> Can you rebase this on current master?  The index hash does not seem to
>>> be valid outside your tree.
>>
>> It's on top of https://sourceware.org/ml/libc-alpha/2019-07/msg00298.html
>>
>> Shall I swap them over and repost both?
> 
> Ah, no need for that then.
> 
> I verified that this fixes the hppa build issue.
> 
> Thanks,
> Florian
> 

LGTM as well, I think next step is to consolidate hppa pthread.h.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] nptl: Add POSIX-proposed _clock functions to hppa pthread.h
  2019-07-17 17:00       ` Adhemerval Zanella
@ 2019-07-18 17:39         ` Carlos O'Donell
  0 siblings, 0 replies; 6+ messages in thread
From: Carlos O'Donell @ 2019-07-18 17:39 UTC (permalink / raw)
  To: Adhemerval Zanella, Florian Weimer, Mike Crowe; +Cc: libc-alpha

On 7/17/19 1:00 PM, Adhemerval Zanella wrote:
> 
> 
> On 17/07/2019 09:44, Florian Weimer wrote:
>> * Mike Crowe:
>>
>>> On Wednesday 17 July 2019 at 10:47:26 +0200, Florian Weimer wrote:
>>>> * Mike Crowe:
>>>>
>>>>> diff --git a/ChangeLog b/ChangeLog
>>>>> index 3d884f2925..c2e3be57d2 100644
>>>>> --- a/ChangeLog
>>>>> +++ b/ChangeLog
>>>>> @@ -1,3 +1,10 @@
>>>>> +2019-07-17  Mike Crowe  <mac@mcrowe.com>
>>>>> +
>>>>> +	* sysdeps/unix/sysv/linux/hppa/pthread.h: Add declarations of
>>>>> +	functions recently added to sysdeps/nptl/pthread.h:
>>>>> +	pthread_mutex_clocklock, pthread_rwlock_clockrdlock,
>>>>> +	pthread_rwlock_clockwrlock and pthread_cond_clockwait.
>>>>> +
>>>>
>>>> Can you rebase this on current master?  The index hash does not seem to
>>>> be valid outside your tree.
>>>
>>> It's on top of https://sourceware.org/ml/libc-alpha/2019-07/msg00298.html
>>>
>>> Shall I swap them over and repost both?
>>
>> Ah, no need for that then.
>>
>> I verified that this fixes the hppa build issue.
>>
>> Thanks,
>> Florian
>>
> 
> LGTM as well, I think next step is to consolidate hppa pthread.h.
> 
> Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
> 

Thanks for pushing this. This looks good to me also, and if Florian
tested it fixes things then we're good.

-- 
Cheers,
Carlos.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-07-18 17:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-17  8:43 [PATCH] nptl: Add POSIX-proposed _clock functions to hppa pthread.h Mike Crowe
2019-07-17  8:47 ` Florian Weimer
2019-07-17  8:58   ` Mike Crowe
2019-07-17 12:44     ` Florian Weimer
2019-07-17 17:00       ` Adhemerval Zanella
2019-07-18 17:39         ` Carlos O'Donell

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).