aboutsummaryrefslogtreecommitdiffstats
path: root/src/vppinfra/lock.h
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2020-10-19 16:05:07 -0400
committerFlorin Coras <florin.coras@gmail.com>2020-10-19 21:36:52 +0000
commit402606c96ba90f3b14047e63765c08e20b9bbf7f (patch)
treecfcf6b6c4857a58df45af602f913fa710c6fa07f /src/vppinfra/lock.h
parent5a59b2bac48611a316adf128bdb0e1e2fe889656 (diff)
vppinfra: minor refactor in lock.h
For whatever reason, "typedef struct { ... } *foo_t" gives cgo a horrible case of indigestion. A minor refactor makes the pain go away. Type: refactor Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I856b2abf9b16348d2f6145178e683e722914c756
Diffstat (limited to 'src/vppinfra/lock.h')
-rw-r--r--src/vppinfra/lock.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/vppinfra/lock.h b/src/vppinfra/lock.h
index 470890b6ec7..b7b3d00a905 100644
--- a/src/vppinfra/lock.h
+++ b/src/vppinfra/lock.h
@@ -48,7 +48,7 @@ do { \
#define CLIB_SPINLOCK_IS_LOCKED(_p) (*(_p))->lock
#define CLIB_SPINLOCK_ASSERT_LOCKED(_p) ASSERT(CLIB_SPINLOCK_IS_LOCKED((_p)))
-typedef struct
+struct clib_spinlock_s
{
CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
u32 lock;
@@ -57,7 +57,9 @@ typedef struct
uword thread_index;
void *frame_address;
#endif
-} *clib_spinlock_t;
+};
+
+typedef struct clib_spinlock_s *clib_spinlock_t;
static inline void
clib_spinlock_init (clib_spinlock_t * p)