On 09:53:15,  3.09.16, Ted Unangst wrote:
> please keep this line.

Index: sys/kern/kern_synch.c
===================================================================
RCS file: /cvs/src/sys/kern/kern_synch.c,v
retrieving revision 1.133
diff -u -p -r1.133 kern_synch.c
--- sys/kern/kern_synch.c       6 Jul 2016 15:53:01 -0000       1.133
+++ sys/kern/kern_synch.c       3 Sep 2016 14:06:32 -0000
@@ -59,7 +59,7 @@
 #endif
 
 int    thrsleep(struct proc *, struct sys___thrsleep_args *);
-int    thrsleep_unlock(void *, int);
+int    thrsleep_unlock(void *);
 
 /*
  * We're only looking at 7 bits of the address; everything is
@@ -454,26 +454,15 @@ sys_sched_yield(struct proc *p, void *v,
 }
 
 int
-thrsleep_unlock(void *lock, int lockflags)
+thrsleep_unlock(void *lock)
 {
        static _atomic_lock_t unlocked = _ATOMIC_LOCK_UNLOCKED;
        _atomic_lock_t *atomiclock = lock;
-       uint32_t *ticket = lock;
-       uint32_t ticketvalue;
-       int error;
 
        if (!lock)
-               return (0);
+               return 0;
 
-       if (lockflags) {
-               if ((error = copyin(ticket, &ticketvalue, sizeof(ticketvalue))))
-                       return (error);
-               ticketvalue++;
-               error = copyout(&ticketvalue, ticket, sizeof(ticketvalue));
-       } else {
-               error = copyout(&unlocked, atomiclock, sizeof(unlocked));
-       }
-       return (error);
+       return copyout(&unlocked, atomiclock, sizeof(unlocked));
 }
 
 static int globalsleepaddr;
@@ -493,8 +482,7 @@ thrsleep(struct proc *p, struct sys___th
        void *lock = SCARG(uap, lock);
        uint64_t to_ticks = 0;
        int abort, error;
-       clockid_t clock_id = SCARG(uap, clock_id) & 0x7;
-       int lockflags = SCARG(uap, clock_id) & 0x8;
+       clockid_t clock_id = SCARG(uap, clock_id);
 
        if (ident == 0)
                return (EINVAL);
@@ -510,7 +498,7 @@ thrsleep(struct proc *p, struct sys___th
 
                if (timespeccmp(tsp, &now, <)) {
                        /* already passed: still do the unlock */
-                       if ((error = thrsleep_unlock(lock, lockflags)))
+                       if ((error = thrsleep_unlock(lock)))
                                return (error);
                        return (EWOULDBLOCK);
                }
@@ -524,9 +512,8 @@ thrsleep(struct proc *p, struct sys___th
 
        p->p_thrslpid = ident;
 
-       if ((error = thrsleep_unlock(lock, lockflags))) {
+       if ((error = thrsleep_unlock(lock)))
                goto out;
-       }
 
        if (SCARG(uap, abort) != NULL) {
                if ((error = copyin(SCARG(uap, abort), &abort,
Index: sys/sys/_time.h
===================================================================
RCS file: /cvs/src/sys/sys/_time.h,v
retrieving revision 1.7
diff -u -p -r1.7 _time.h
--- sys/sys/_time.h     16 Oct 2014 15:50:49 -0000      1.7
+++ sys/sys/_time.h     3 Sep 2016 14:06:32 -0000
@@ -39,8 +39,6 @@
 #define CLOCK_UPTIME                   5
 
 #if __BSD_VISIBLE
-#define        __CLOCK_USE_TICKET_LOCKS        8       /* flag for 
__thrsleep() */
-
 /*
  * Per-process and per-thread clocks encode the PID or TID into the
  * high bits, with the type in the bottom bits

-- 
Michal Mazurek

Reply via email to