Module Name:    src
Committed By:   riastradh
Date:           Wed Mar  5 14:01:20 UTC 2025

Modified Files:
        src/sys/kern: sys_futex.c

Log Message:
futex(2): Fix some comments to match the usual argument order.

No functional change intenteded.

Prompted by:

PR kern/59129: futex(3): missing sign extension in FUTEX_WAKE_OP


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/kern/sys_futex.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/sys_futex.c
diff -u src/sys/kern/sys_futex.c:1.23 src/sys/kern/sys_futex.c:1.24
--- src/sys/kern/sys_futex.c:1.23	Wed Mar  5 12:02:00 2025
+++ src/sys/kern/sys_futex.c	Wed Mar  5 14:01:20 2025
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_futex.c,v 1.23 2025/03/05 12:02:00 riastradh Exp $	*/
+/*	$NetBSD: sys_futex.c,v 1.24 2025/03/05 14:01:20 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2018, 2019, 2020 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sys_futex.c,v 1.23 2025/03/05 12:02:00 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_futex.c,v 1.24 2025/03/05 14:01:20 riastradh Exp $");
 
 /*
  * Futexes
@@ -59,7 +59,8 @@ __KERNEL_RCSID(0, "$NetBSD: sys_futex.c,
  *				// then retry.
  *				if (atomic_cas_uint(&lock, v, v | 2) != v)
  *					continue;
- *				futex(FUTEX_WAIT, &lock, v | 2, NULL, NULL, 0);
+ *				futex(&lock, FUTEX_WAIT, v | 2, NULL, NULL, 0,
+ *				    0);
  *				continue;
  *			}
  *		} while (atomic_cas_uint(&lock, v, v | 1) != v);
@@ -75,7 +76,7 @@ __KERNEL_RCSID(0, "$NetBSD: sys_futex.c,
  *			v = atomic_swap_uint(&lock, 0);
  *			// If there are still waiters, wake one.
  *			if (v & 2)
- *				futex(FUTEX_WAKE, &lock, 1, NULL, NULL, 0);
+ *				futex(&lock, FUTEX_WAKE, 1, NULL, NULL, 0, 0);
  *		}
  *
  *	The goal is to avoid the futex system call unless there is
@@ -92,7 +93,7 @@ __KERNEL_RCSID(0, "$NetBSD: sys_futex.c,
  *	waiters into buckets by hashing the lock addresses to reduce
  *	the incidence of spurious wakeups.  But this is not all.
  *
- *	The futex(FUTEX_CMP_REQUEUE, &lock, n, &lock2, m, val)
+ *	The futex(&lock, FUTEX_CMP_REQUEUE, n, timeout, &lock2, m, val)
  *	operation not only wakes n waiters on lock if lock == val, but
  *	also _transfers_ m additional waiters to lock2.  Unless wakeups
  *	on lock2 also trigger wakeups on lock, we cannot move waiters

Reply via email to