Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libpthread Deal with more lwp_park() timestamp unconsting



details:   https://anonhg.NetBSD.org/src/rev/69b078a058d4
branches:  trunk
changeset: 828319:69b078a058d4
user:      kre <kre%NetBSD.org@localhost>
date:      Fri Dec 08 09:24:31 2017 +0000

description:
Deal with more lwp_park() timestamp unconsting

diffstat:

 lib/libpthread/pthread.c        |  8 ++++----
 lib/libpthread/pthread_compat.c |  8 +++++---
 lib/libpthread/pthread_mutex.c  |  9 +++++----
 3 files changed, 14 insertions(+), 11 deletions(-)

diffs (88 lines):

diff -r 786a7d83c3d0 -r 69b078a058d4 lib/libpthread/pthread.c
--- a/lib/libpthread/pthread.c  Fri Dec 08 09:14:36 2017 +0000
+++ b/lib/libpthread/pthread.c  Fri Dec 08 09:24:31 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pthread.c,v 1.150 2017/07/11 15:21:35 joerg Exp $      */
+/*     $NetBSD: pthread.c,v 1.151 2017/12/08 09:24:31 kre Exp $        */
 
 /*-
  * Copyright (c) 2001, 2002, 2003, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: pthread.c,v 1.150 2017/07/11 15:21:35 joerg Exp $");
+__RCSID("$NetBSD: pthread.c,v 1.151 2017/12/08 09:24:31 kre Exp $");
 
 #define        __EXPOSE_STACK  1
 
@@ -1202,8 +1202,8 @@
                 * If we deferred unparking a thread, arrange to
                 * have _lwp_park() restart it before blocking.
                 */
-               error = _lwp_park(CLOCK_REALTIME, TIMER_ABSTIME, abstime,
-                   self->pt_unpark, hint, hint);
+               error = _lwp_park(CLOCK_REALTIME, TIMER_ABSTIME,
+                   __UNCONST(abstime), self->pt_unpark, hint, hint);
                self->pt_unpark = 0;
                if (error != 0) {
                        switch (rv = errno) {
diff -r 786a7d83c3d0 -r 69b078a058d4 lib/libpthread/pthread_compat.c
--- a/lib/libpthread/pthread_compat.c   Fri Dec 08 09:14:36 2017 +0000
+++ b/lib/libpthread/pthread_compat.c   Fri Dec 08 09:24:31 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pthread_compat.c,v 1.3 2014/01/31 20:44:01 christos Exp $      */
+/*     $NetBSD: pthread_compat.c,v 1.4 2017/12/08 09:24:31 kre Exp $   */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: pthread_compat.c,v 1.3 2014/01/31 20:44:01 christos Exp $");
+__RCSID("$NetBSD: pthread_compat.c,v 1.4 2017/12/08 09:24:31 kre Exp $");
 
 #include <sys/param.h>
 #include <sys/syscall.h>
@@ -89,7 +89,9 @@
     const void *e, const void *f)
 {
 
-       return syscall(SYS____lwp_park60, a, b, c, d, e, f);
+       struct timespec t = *c;
+
+       return syscall(SYS____lwp_park60, a, b, &t, d, e, f);
 }
 
 int
diff -r 786a7d83c3d0 -r 69b078a058d4 lib/libpthread/pthread_mutex.c
--- a/lib/libpthread/pthread_mutex.c    Fri Dec 08 09:14:36 2017 +0000
+++ b/lib/libpthread/pthread_mutex.c    Fri Dec 08 09:24:31 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pthread_mutex.c,v 1.63 2016/10/31 23:53:12 christos Exp $      */
+/*     $NetBSD: pthread_mutex.c,v 1.64 2017/12/08 09:24:31 kre Exp $   */
 
 /*-
  * Copyright (c) 2001, 2003, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -47,7 +47,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: pthread_mutex.c,v 1.63 2016/10/31 23:53:12 christos Exp $");
+__RCSID("$NetBSD: pthread_mutex.c,v 1.64 2017/12/08 09:24:31 kre Exp $");
 
 #include <sys/types.h>
 #include <sys/lwpctl.h>
@@ -394,8 +394,9 @@
                 */
                while (self->pt_mutexwait) {
                        self->pt_blocking++;
-                       error = _lwp_park(CLOCK_REALTIME, TIMER_ABSTIME, ts,
-                           self->pt_unpark, __UNVOLATILE(&ptm->ptm_waiters),
+                       error = _lwp_park(CLOCK_REALTIME, TIMER_ABSTIME,
+                           __UNCONST(ts), self->pt_unpark,
+                           __UNVOLATILE(&ptm->ptm_waiters),
                            __UNVOLATILE(&ptm->ptm_waiters));
                        self->pt_unpark = 0;
                        self->pt_blocking--;



Home | Main Index | Thread Index | Old Index