summaryrefslogtreecommitdiff
path: root/lib/libpthread/pthread_spin.c
diff options
context:
space:
mode:
authorriastradh <riastradh@NetBSD.org>2022-02-12 14:59:32 +0000
committerriastradh <riastradh@NetBSD.org>2022-02-12 14:59:32 +0000
commitf2e0628f7851077c9682dc1f7e68b04739882a6f (patch)
tree3c06acd2d8998d5c421a28eac9f049b86f457082 /lib/libpthread/pthread_spin.c
parent0748618c750aaf37cdcbbcc466e31e199ae3ab1f (diff)
libpthread: Move namespacing include to top of .c files.
Stuff like libc's namespace.h, or atomic_op_namespace.h, which does namespacing tricks like `#define atomic_cas_uint _atomic_cas_uint', has to go at the top of each .c file. If it goes in the middle, it might be too late to affect the declarations, and result in compile errors. I tripped over this by including <sys/atomic.h> in mips <machine/lock.h>. (Maybe we should create a new pthread_namespace.h file for the purpose, but this'll do for now.)
Diffstat (limited to 'lib/libpthread/pthread_spin.c')
-rw-r--r--lib/libpthread/pthread_spin.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/libpthread/pthread_spin.c b/lib/libpthread/pthread_spin.c
index 66db6113f23..4ba0d925222 100644
--- a/lib/libpthread/pthread_spin.c
+++ b/lib/libpthread/pthread_spin.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pthread_spin.c,v 1.8 2020/02/05 11:05:10 kamil Exp $ */
+/* $NetBSD: pthread_spin.c,v 1.9 2022/02/12 14:59:32 riastradh Exp $ */
/*-
* Copyright (c) 2001, 2006, 2007 The NetBSD Foundation, Inc.
@@ -34,7 +34,10 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: pthread_spin.c,v 1.8 2020/02/05 11:05:10 kamil Exp $");
+__RCSID("$NetBSD: pthread_spin.c,v 1.9 2022/02/12 14:59:32 riastradh Exp $");
+
+/* Need to use libc-private names for atomic operations. */
+#include "../../common/lib/libc/atomic/atomic_op_namespace.h"
#include <sys/types.h>
#include <sys/ras.h>