aboutsummaryrefslogtreecommitdiffstats
path: root/src/svm/ssvm.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/svm/ssvm.h')
-rw-r--r--src/svm/ssvm.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/svm/ssvm.h b/src/svm/ssvm.h
index 1c0373f126c..6c679456bff 100644
--- a/src/svm/ssvm.h
+++ b/src/svm/ssvm.h
@@ -37,6 +37,7 @@
#include <vppinfra/heap.h>
#include <vppinfra/pool.h>
#include <vppinfra/format.h>
+#include <vppinfra/lock.h>
#ifndef MMAP_PAGESIZE
#define MMAP_PAGESIZE (clib_mem_get_page_size())
@@ -104,7 +105,7 @@ ssvm_lock (ssvm_shared_header_t * h, u32 my_pid, u32 tag)
}
while (clib_atomic_test_and_set (&h->lock))
- ;
+ CLIB_PAUSE ();
h->owner_pid = my_pid;
h->recursion_count = 1;
@@ -115,7 +116,7 @@ always_inline void
ssvm_lock_non_recursive (ssvm_shared_header_t * h, u32 tag)
{
while (clib_atomic_test_and_set (&h->lock))
- ;
+ CLIB_PAUSE ();
h->tag = tag;
}