git-lll-ptr
authorGNU Libc Maintainers <debian-glibc@lists.debian.org>
Sun, 28 Jan 2024 22:58:14 +0000 (23:58 +0100)
committerAurelien Jarno <aurel32@debian.org>
Sun, 28 Jan 2024 22:58:14 +0000 (23:58 +0100)
Commited for 2.33

commit 3934901a7444329d18b5edc6cb0d91fed35aeaaf
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Sun Dec 13 10:37:24 2020 +0000

    hurd: make lll_* take a variable instead of a ptr

    To be coherent with other ports, let's make lll_* take a variable, and
    rename those that keep taking a ptr into __lll_*.

Gbp-Pq: Topic hurd-i386
Gbp-Pq: Name git-lll-ptr.diff

14 files changed:
hurd/hurdlock.c
hurd/hurdlock.h
hurd/hurdpid.c
mach/lock-intern.h
mach/lowlevellock.h
sysdeps/mach/hurd/htl/pt-mutex-lock.c
sysdeps/mach/hurd/htl/pt-mutex-timedlock.c
sysdeps/mach/hurd/htl/pt-mutex-trylock.c
sysdeps/mach/hurd/htl/pt-mutex-unlock.c
sysdeps/mach/hurd/htl/pt-mutex.h
sysdeps/mach/hurd/setpgid.c
sysdeps/mach/hurd/setsid.c
sysdeps/mach/hurd/tls.h
sysdeps/mach/libc-lock.h

index 50da0a21212ed9346cbd4ab32f10ac1e8e385275..0bed500e57c1ac0dc5f924140bbc6db89a8170b3 100644 (file)
@@ -48,7 +48,7 @@ __lll_abstimed_wait (void *ptr, int val,
   const struct timespec *tsp, int flags, int clk)
 {
   int mlsec = compute_reltime (tsp, clk);
-  return mlsec < 0 ? KERN_TIMEDOUT : lll_timed_wait (ptr, val, mlsec, flags);
+  return mlsec < 0 ? KERN_TIMEDOUT : __lll_timed_wait (ptr, val, mlsec, flags);
 }
 
 int
@@ -56,7 +56,7 @@ __lll_abstimed_xwait (void *ptr, int lo, int hi,
   const struct timespec *tsp, int flags, int clk)
 {
   int mlsec = compute_reltime (tsp, clk);
-  return mlsec < 0 ? KERN_TIMEDOUT : lll_timed_xwait (ptr, lo, hi, mlsec,
+  return mlsec < 0 ? KERN_TIMEDOUT : __lll_timed_xwait (ptr, lo, hi, mlsec,
                                                      flags);
 }
 
@@ -64,7 +64,7 @@ int
 __lll_abstimed_lock (void *ptr,
   const struct timespec *tsp, int flags, int clk)
 {
-  if (lll_trylock (ptr) == 0)
+  if (__lll_trylock (ptr) == 0)
     return 0;
 
   while (1)
@@ -75,7 +75,7 @@ __lll_abstimed_lock (void *ptr,
         return EINVAL;
 
       int mlsec = compute_reltime (tsp, clk);
-      if (mlsec < 0 || lll_timed_wait (ptr, 2, mlsec, flags) == KERN_TIMEDOUT)
+      if (mlsec < 0 || __lll_timed_wait (ptr, 2, mlsec, flags) == KERN_TIMEDOUT)
         return ETIMEDOUT;
     }
 }
@@ -131,7 +131,7 @@ __lll_robust_lock (void *ptr, int flags)
         }
       else
         {
-          lll_timed_wait (iptr, val, wait_time, flags);
+          __lll_timed_wait (iptr, val, wait_time, flags);
           if (wait_time < MAX_WAIT_TIME)
             wait_time <<= 1;
         }
@@ -175,7 +175,7 @@ __lll_robust_abstimed_lock (void *ptr,
           else if (mlsec > wait_time)
             mlsec = wait_time;
 
-          int res = lll_timed_wait (iptr, val, mlsec, flags);
+          int res = __lll_timed_wait (iptr, val, mlsec, flags);
           if (res == KERN_TIMEDOUT)
             return ETIMEDOUT;
           else if (wait_time < MAX_WAIT_TIME)
@@ -211,7 +211,7 @@ __lll_robust_unlock (void *ptr, int flags)
     {
       if (val & LLL_WAITERS)
         {
-          lll_set_wake (ptr, 0, flags);
+          __lll_set_wake (ptr, 0, flags);
           break;
         }
       else if (atomic_compare_exchange_weak_release ((unsigned int *)ptr, &val, 0))
index 362bcf6cc2b5a17e160ebc220360919429bdd262..c1df42bea4d07041a902a1e8aa9e3369d64f8db7 100644 (file)
@@ -31,21 +31,21 @@ struct timespec;
 
 /* Wait on 64-bit address PTR, without blocking if its contents
    are different from the pair <LO, HI>.  */
-#define lll_xwait(ptr, lo, hi, flags) \
+#define __lll_xwait(ptr, lo, hi, flags) \
   __gsync_wait (__mach_task_self (), \
     (vm_offset_t)ptr, lo, hi, 0, flags | GSYNC_QUAD)
 
-/* Same as 'lll_wait', but only block for MLSEC milliseconds.  */
-#define lll_timed_wait(ptr, val, mlsec, flags) \
+/* Same as '__lll_wait', but only block for MLSEC milliseconds.  */
+#define __lll_timed_wait(ptr, val, mlsec, flags) \
   __gsync_wait (__mach_task_self (), \
     (vm_offset_t)ptr, val, 0, mlsec, flags | GSYNC_TIMED)
 
-/* Same as 'lll_xwait', but only block for MLSEC milliseconds.  */
-#define lll_timed_xwait(ptr, lo, hi, mlsec, flags) \
+/* Same as '__lll_xwait', but only block for MLSEC milliseconds.  */
+#define __lll_timed_xwait(ptr, lo, hi, mlsec, flags) \
   __gsync_wait (__mach_task_self (), (vm_offset_t)ptr, \
     lo, hi, mlsec, flags | GSYNC_TIMED | GSYNC_QUAD)
 
-/* Same as 'lll_wait', but only block until TSP elapses,
+/* Same as '__lll_wait', but only block until TSP elapses,
    using clock CLK.  */
 extern int __lll_abstimed_wait (void *__ptr, int __val,
   const struct timespec *__tsp, int __flags, int __clk);
@@ -63,6 +63,8 @@ extern int __lll_abstimed_lock (void *__ptr,
 /* Acquire the lock at PTR, but return with an error if
    the process containing the owner thread dies.  */
 extern int __lll_robust_lock (void *__ptr, int __flags);
+#define lll_robust_lock(var, flags) \
+  __lll_robust_lock (&(var), flags)
 
 /* Same as '__lll_robust_lock', but only block until TSP
    elapses, using clock CLK.  */
@@ -72,19 +74,23 @@ extern int __lll_robust_abstimed_lock (void *__ptr,
 /* Same as '__lll_robust_lock', but return with an error
    if the lock cannot be acquired without blocking.  */
 extern int __lll_robust_trylock (void *__ptr);
+#define lll_robust_trylock(var) \
+  __lll_robust_trylock (&(var))
 
 /* Wake one or more threads waiting on address PTR,
    setting its value to VAL before doing so.  */
-#define lll_set_wake(ptr, val, flags) \
+#define __lll_set_wake(ptr, val, flags) \
   __gsync_wake (__mach_task_self (), \
     (vm_offset_t)ptr, val, flags | GSYNC_MUTATE)
 
 /* Release the robust lock at PTR.  */
 extern void __lll_robust_unlock (void *__ptr, int __flags);
+#define lll_robust_unlock(var, flags) \
+  __lll_robust_unlock (&(var), flags)
 
 /* Rearrange threads waiting on address SRC to instead wait on
    DST, waking one of them if WAIT_ONE is non-zero.  */
-#define lll_requeue(src, dst, wake_one, flags) \
+#define __lll_requeue(src, dst, wake_one, flags) \
   __gsync_requeue (__mach_task_self (), (vm_offset_t)src, \
     (vm_offset_t)dst, (boolean_t)wake_one, flags)
 
@@ -93,31 +99,31 @@ extern void __lll_robust_unlock (void *__ptr, int __flags);
    every one of these calls, defaulting to CLOCK_REALTIME if
    no argument is passed.  */
 
-#define lll_abstimed_wait(ptr, val, tsp, flags, ...)   \
+#define lll_abstimed_wait(var, val, tsp, flags, ...)   \
   ({   \
      const clockid_t __clk[] = { CLOCK_REALTIME, ##__VA_ARGS__ };   \
-     __lll_abstimed_wait ((ptr), (val), (tsp), (flags),   \
+     __lll_abstimed_wait (&(var), (val), (tsp), (flags),   \
        __clk[sizeof (__clk) / sizeof (__clk[0]) - 1]);   \
    })
 
-#define lll_abstimed_xwait(ptr, lo, hi, tsp, flags, ...)   \
+#define lll_abstimed_xwait(var, lo, hi, tsp, flags, ...)   \
   ({   \
      const clockid_t __clk[] = { CLOCK_REALTIME, ##__VA_ARGS__ };   \
-     __lll_abstimed_xwait ((ptr), (lo), (hi), (tsp), (flags),   \
+     __lll_abstimed_xwait (&(var), (lo), (hi), (tsp), (flags),   \
        __clk[sizeof (__clk) / sizeof (__clk[0]) - 1]);   \
    })
 
-#define lll_abstimed_lock(ptr, tsp, flags, ...)   \
+#define lll_abstimed_lock(var, tsp, flags, ...)   \
   ({   \
      const clockid_t __clk[] = { CLOCK_REALTIME, ##__VA_ARGS__ };   \
-     __lll_abstimed_lock ((ptr), (tsp), (flags),   \
+     __lll_abstimed_lock (&(var), (tsp), (flags),   \
        __clk[sizeof (__clk) / sizeof (__clk[0]) - 1]);   \
    })
 
-#define lll_robust_abstimed_lock(ptr, tsp, flags, ...)   \
+#define lll_robust_abstimed_lock(var, tsp, flags, ...)   \
   ({   \
      const clockid_t __clk[] = { CLOCK_REALTIME, ##__VA_ARGS__ };   \
-     __lll_robust_abstimed_lock ((ptr), (tsp), (flags),   \
+     __lll_robust_abstimed_lock (&(var), (tsp), (flags),   \
        __clk[sizeof (__clk) / sizeof (__clk[0]) - 1]);   \
    })
 
index dd8281cda7c4478c17e33e4c82ccbbe648928339..5607570d4b7e55b7343cf4d0677e78864dd68ee6 100644 (file)
@@ -66,7 +66,7 @@ _S_msg_proc_newids (mach_port_t me,
 
   /* Notify any waiting user threads that the id change as been completed.  */
   ++_hurd_pids_changed_stamp;
-  lll_wake (&_hurd_pids_changed_stamp, GSYNC_BROADCAST);
+  lll_wake (_hurd_pids_changed_stamp, GSYNC_BROADCAST);
 
   return 0;
 }
index 62faf98039404080df46f962f9c2d40249ef15fc..77fc4d17f837326ed8e7fa6737b1bb8be12ff02f 100644 (file)
@@ -57,7 +57,7 @@ extern void __spin_lock (__spin_lock_t *__lock);
 _EXTERN_INLINE void
 __spin_lock (__spin_lock_t *__lock)
 {
-  lll_lock (__lock, 0);
+  __lll_lock (__lock, 0);
 }
 #endif
 
@@ -68,7 +68,7 @@ extern void __spin_unlock (__spin_lock_t *__lock);
 _EXTERN_INLINE void
 __spin_unlock (__spin_lock_t *__lock)
 {
-  lll_unlock (__lock, 0);
+  __lll_unlock (__lock, 0);
 }
 #endif
 
@@ -79,7 +79,7 @@ extern int __spin_try_lock (__spin_lock_t *__lock);
 _EXTERN_INLINE int
 __spin_try_lock (__spin_lock_t *__lock)
 {
-  return (lll_trylock (__lock) == 0);
+  return (__lll_trylock (__lock) == 0);
 }
 #endif
 
index cf67ccd58985245f8a23878f7454fc8adbb99159..0a22a030b46946c3eddf2292980ef27abe4eab50 100644 (file)
 
 /* Wait on address PTR, without blocking if its contents
  * are different from VAL.  */
-#define lll_wait(ptr, val, flags)   \
+#define __lll_wait(ptr, val, flags)   \
   __gsync_wait (__mach_task_self (),   \
     (vm_offset_t)(ptr), (val), 0, 0, (flags))
+#define lll_wait(var, val, flags) \
+  __lll_wait (&(var), val, flags)
 
 /* Wake one or more threads waiting on address PTR.  */
-#define lll_wake(ptr, flags)   \
+#define __lll_wake(ptr, flags)   \
   __gsync_wake (__mach_task_self (), (vm_offset_t)(ptr), 0, (flags))
+#define lll_wake(var, flags) \
+  __lll_wake (&(var), flags)
 
 /* Acquire the lock at PTR.  */
-#define lll_lock(ptr, flags)   \
+#define __lll_lock(ptr, flags)   \
   ({   \
      int *__iptr = (int *)(ptr);   \
      int __flags = (flags);   \
          {   \
            if (atomic_exchange_acq (__iptr, 2) == 0)   \
              break;   \
-           lll_wait (__iptr, 2, __flags);   \
+           __lll_wait (__iptr, 2, __flags);   \
          }   \
      (void)0;   \
    })
+#define lll_lock(var, flags) \
+  __lll_lock (&(var), flags)
 
 /* Try to acquire the lock at PTR, without blocking.
    Evaluates to zero on success.  */
-#define lll_trylock(ptr)   \
+#define __lll_trylock(ptr)   \
   ({   \
      int *__iptr = (int *)(ptr);   \
      *__iptr == 0   \
        && atomic_compare_and_exchange_bool_acq (__iptr, 1, 0) == 0 ? 0 : -1;   \
    })
+#define lll_trylock(var) \
+  __lll_trylock (&(var))
 
 /* Release the lock at PTR.  */
-#define lll_unlock(ptr, flags)   \
+#define __lll_unlock(ptr, flags)   \
   ({   \
      int *__iptr = (int *)(ptr);   \
      if (atomic_exchange_rel (__iptr, 0) == 2)   \
-       lll_wake (__iptr, (flags));   \
+       __lll_wake (__iptr, (flags));   \
      (void)0;   \
    })
+#define lll_unlock(var, flags) \
+  __lll_unlock (&(var), flags)
 
 #endif
index 6d334a29772ca92e58dadc0a0a3022ecdc56d8ee..d735fb966164c65e200fe67c7b8df61708e866c8 100644 (file)
@@ -33,7 +33,7 @@ __pthread_mutex_lock (pthread_mutex_t *mtxp)
   switch (MTX_TYPE (mtxp))
     {
     case PT_MTX_NORMAL:
-      lll_lock (&mtxp->__lock, flags);
+      lll_lock (mtxp->__lock, flags);
       break;
 
     case PT_MTX_RECURSIVE:
@@ -47,7 +47,7 @@ __pthread_mutex_lock (pthread_mutex_t *mtxp)
          return ret;
        }
 
-      lll_lock (&mtxp->__lock, flags);
+      lll_lock (mtxp->__lock, flags);
       mtx_set_owner (mtxp, self, flags);
       mtxp->__cnt = 1;
       break;
@@ -57,7 +57,7 @@ __pthread_mutex_lock (pthread_mutex_t *mtxp)
       if (mtx_owned_p (mtxp, self, flags))
        return EDEADLK;
 
-      lll_lock (&mtxp->__lock, flags);
+      lll_lock (mtxp->__lock, flags);
       mtx_set_owner (mtxp, self, flags);
       break;
 
@@ -65,7 +65,7 @@ __pthread_mutex_lock (pthread_mutex_t *mtxp)
     case PT_MTX_RECURSIVE | PTHREAD_MUTEX_ROBUST:
     case PT_MTX_ERRORCHECK | PTHREAD_MUTEX_ROBUST:
       self = _pthread_self ();
-      ROBUST_LOCK (self, mtxp, __lll_robust_lock, flags);
+      ROBUST_LOCK (self, mtxp, lll_robust_lock, flags);
       break;
 
     default:
index e83bc5787565a1cd91405120d9d87326d237f3b1..ee2a3ebf6af2800ce3adf71881e2ca71f963148f 100644 (file)
@@ -32,7 +32,7 @@ __pthread_mutex_timedlock (pthread_mutex_t *mtxp, const struct timespec *tsp)
   switch (MTX_TYPE (mtxp))
     {
     case PT_MTX_NORMAL:
-      ret = lll_abstimed_lock (&mtxp->__lock, tsp, flags);
+      ret = lll_abstimed_lock (mtxp->__lock, tsp, flags);
       break;
 
     case PT_MTX_RECURSIVE:
@@ -45,7 +45,7 @@ __pthread_mutex_timedlock (pthread_mutex_t *mtxp, const struct timespec *tsp)
          ++mtxp->__cnt;
          ret = 0;
        }
-      else if ((ret = lll_abstimed_lock (&mtxp->__lock, tsp, flags)) == 0)
+      else if ((ret = lll_abstimed_lock (mtxp->__lock, tsp, flags)) == 0)
        {
          mtx_set_owner (mtxp, self, flags);
          mtxp->__cnt = 1;
@@ -57,7 +57,7 @@ __pthread_mutex_timedlock (pthread_mutex_t *mtxp, const struct timespec *tsp)
       self = _pthread_self ();
       if (mtx_owned_p (mtxp, self, flags))
        ret = EDEADLK;
-      else if ((ret = lll_abstimed_lock (&mtxp->__lock, tsp, flags)) == 0)
+      else if ((ret = lll_abstimed_lock (mtxp->__lock, tsp, flags)) == 0)
        mtx_set_owner (mtxp, self, flags);
 
       break;
index 5708caf096452ee856b3b2f737931727d92f62cf..61fedf147f0bf9cb7a2afb094a6d273926232740 100644 (file)
@@ -32,7 +32,7 @@ __pthread_mutex_trylock (pthread_mutex_t *mtxp)
   switch (MTX_TYPE (mtxp))
     {
     case PT_MTX_NORMAL:
-      ret = lll_trylock (&mtxp->__lock);
+      ret = lll_trylock (mtxp->__lock);
       if (ret)
        ret = EBUSY;
       break;
@@ -47,7 +47,7 @@ __pthread_mutex_trylock (pthread_mutex_t *mtxp)
          ++mtxp->__cnt;
          ret = 0;
        }
-      else if ((ret = lll_trylock (&mtxp->__lock)) == 0)
+      else if ((ret = lll_trylock (mtxp->__lock)) == 0)
        {
          mtx_set_owner (mtxp, self, mtxp->__flags);
          mtxp->__cnt = 1;
@@ -59,7 +59,7 @@ __pthread_mutex_trylock (pthread_mutex_t *mtxp)
 
     case PT_MTX_ERRORCHECK:
       self = _pthread_self ();
-      if ((ret = lll_trylock (&mtxp->__lock)) == 0)
+      if ((ret = lll_trylock (mtxp->__lock)) == 0)
        mtx_set_owner (mtxp, self, mtxp->__flags);
       else
        ret = EBUSY;
@@ -69,7 +69,7 @@ __pthread_mutex_trylock (pthread_mutex_t *mtxp)
     case PT_MTX_RECURSIVE | PTHREAD_MUTEX_ROBUST:
     case PT_MTX_ERRORCHECK | PTHREAD_MUTEX_ROBUST:
       self = _pthread_self ();
-      ROBUST_LOCK (self, mtxp, __lll_robust_trylock);
+      ROBUST_LOCK (self, mtxp, lll_robust_trylock);
       break;
 
     default:
index 4b99a710f154366661ef057b9ee12dccd0c689d7..88e4b61ef4c7fa6a4cb4f3062d059c27deaea182 100644 (file)
@@ -32,7 +32,7 @@ __pthread_mutex_unlock (pthread_mutex_t *mtxp)
   switch (MTX_TYPE (mtxp))
     {
     case PT_MTX_NORMAL:
-      lll_unlock (&mtxp->__lock, flags);
+      lll_unlock (mtxp->__lock, flags);
       break;
 
     case PT_MTX_RECURSIVE:
@@ -42,7 +42,7 @@ __pthread_mutex_unlock (pthread_mutex_t *mtxp)
       else if (--mtxp->__cnt == 0)
        {
          mtxp->__owner_id = mtxp->__shpid = 0;
-         lll_unlock (&mtxp->__lock, flags);
+         lll_unlock (mtxp->__lock, flags);
        }
 
       break;
@@ -54,7 +54,7 @@ __pthread_mutex_unlock (pthread_mutex_t *mtxp)
       else
        {
          mtxp->__owner_id = mtxp->__shpid = 0;
-         lll_unlock (&mtxp->__lock, flags);
+         lll_unlock (mtxp->__lock, flags);
        }
 
       break;
@@ -74,7 +74,7 @@ __pthread_mutex_unlock (pthread_mutex_t *mtxp)
           * state, mark it as irrecoverable. */
          mtxp->__owner_id = ((mtxp->__lock & LLL_DEAD_OWNER)
                              ? NOTRECOVERABLE_ID : 0);
-         __lll_robust_unlock (&mtxp->__lock, flags);
+         lll_robust_unlock (mtxp->__lock, flags);
        }
 
       break;
index 578478fcafadcba998e0a5b90b510e9524f3c426..ead7c91c4fa0694123ace30b8bb5fea5d84b990c 100644 (file)
@@ -42,7 +42,7 @@
         return EDEADLK;   \
     }   \
   \
-  ret = cb (&mtxp->__lock, ##__VA_ARGS__);   \
+  ret = cb (mtxp->__lock, ##__VA_ARGS__);   \
   if (ret == 0 || ret == EOWNERDEAD)   \
     {   \
       if (mtxp->__owner_id == ENOTRECOVERABLE)   \
index 4bb90c48c704c1ee9d00654e861dbd5a4da11ca0..41562b77e568670ac6f6158aeb02e2050b1324f3 100644 (file)
@@ -39,7 +39,7 @@ __setpgid (pid_t pid, pid_t pgid)
     /* Synchronize with the signal thread to make sure we have
        received and processed proc_newids before returning to the user.  */
     while (_hurd_pids_changed_stamp == stamp)
-      lll_wait (&_hurd_pids_changed_stamp, stamp, 0);
+      lll_wait (_hurd_pids_changed_stamp, stamp, 0);
 
   return 0;
 
index b297473a867b8b7cabf964e22e38901713f4ec71..f5c95a334eb88b28c3a76efbe16d43f33681021a 100644 (file)
@@ -56,7 +56,7 @@ __setsid (void)
         returned by `getpgrp ()' in other threads) has been updated before
         we return.  */
       while (_hurd_pids_changed_stamp == stamp)
-        lll_wait (&_hurd_pids_changed_stamp, stamp, 0);
+        lll_wait (_hurd_pids_changed_stamp, stamp, 0);
     }
 
   HURD_CRITICAL_END;
index 3b909444e1704e114038410325583bf568cbca96..40685828bd110af0761af4612eaf11bf4406f683 100644 (file)
@@ -61,7 +61,7 @@
 #define THREAD_GSCOPE_RESET_FLAG() \
   do                                                                         \
     if (atomic_exchange_and_add_rel (&GL(dl_thread_gscope_count), -1) == 1)   \
-      lll_wake (&GL(dl_thread_gscope_count), 0);                             \
+      lll_wake (GL(dl_thread_gscope_count), 0);                                      \
   while (0)
 #define THREAD_GSCOPE_WAIT() \
   do                                                                         \
@@ -69,7 +69,7 @@
       int count;                                                             \
       atomic_write_barrier ();                                               \
       while ((count = GL(dl_thread_gscope_count)))                           \
-        lll_wait (&GL(dl_thread_gscope_count), count, 0);                    \
+        lll_wait (GL(dl_thread_gscope_count), count, 0);                     \
     }                                                                        \
   while (0)
 
index 05de79c96e10387218197b349296b60ff9add37e..dffed2a34b7a17abafa799464f1da7299c581505 100644 (file)
@@ -74,14 +74,14 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
 
 /* Lock the named lock variable.  */
 #define __libc_lock_lock(NAME)   \
-  ({ lll_lock (&(NAME), 0); 0; })
+  ({ lll_lock ((NAME), 0); 0; })
 
 /* Lock the named lock variable.  */
-#define __libc_lock_trylock(NAME) lll_trylock (&(NAME))
+#define __libc_lock_trylock(NAME) lll_trylock (NAME)
 
 /* Unlock the named lock variable.  */
 #define __libc_lock_unlock(NAME)   \
-  ({ lll_unlock (&(NAME), 0); 0; })
+  ({ lll_unlock ((NAME), 0); 0; })
 
 #define __libc_lock_define_recursive(CLASS,NAME) \
   CLASS __libc_lock_recursive_t NAME;
@@ -111,7 +111,7 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
      int __r = 0;   \
      if (__self == __lock->owner)   \
        ++__lock->cnt;   \
-     else if ((__r = lll_trylock (&__lock->lock)) == 0)   \
+     else if ((__r = lll_trylock (__lock->lock)) == 0)   \
        __lock->owner = __self, __lock->cnt = 1;   \
      __r;   \
    })
@@ -122,7 +122,7 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
      void *__self = __libc_lock_owner_self ();   \
      if (__self != __lock->owner)   \
        {   \
-         lll_lock (&__lock->lock, 0);   \
+         lll_lock (__lock->lock, 0);   \
          __lock->owner = __self;   \
        }   \
      ++__lock->cnt;   \
@@ -135,7 +135,7 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
      if (--__lock->cnt == 0)   \
        {   \
          __lock->owner = 0;   \
-         lll_unlock (&__lock->lock, 0);   \
+         lll_unlock (__lock->lock, 0);   \
        }   \
    })