diff options
Diffstat (limited to 'src/vppinfra')
-rw-r--r-- | src/vppinfra/elog.c | 3 | ||||
-rw-r--r-- | src/vppinfra/mheap.c | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/vppinfra/elog.c b/src/vppinfra/elog.c index 12ac3a596e4..489ccf436d9 100644 --- a/src/vppinfra/elog.c +++ b/src/vppinfra/elog.c @@ -41,13 +41,14 @@ #include <vppinfra/format.h> #include <vppinfra/hash.h> #include <vppinfra/math.h> +#include <vppinfra/lock.h> static inline void elog_lock (elog_main_t * em) { if (PREDICT_FALSE (em->lock != 0)) while (clib_atomic_test_and_set (em->lock)) - ; + CLIB_PAUSE (); } static inline void diff --git a/src/vppinfra/mheap.c b/src/vppinfra/mheap.c index ba5bbc9b6e7..2769838d4ba 100644 --- a/src/vppinfra/mheap.c +++ b/src/vppinfra/mheap.c @@ -41,6 +41,7 @@ #include <vppinfra/mheap.h> #include <vppinfra/os.h> #include <vppinfra/time.h> +#include <vppinfra/lock.h> #ifdef CLIB_UNIX #include <vppinfra/elf_clib.h> @@ -64,7 +65,7 @@ mheap_maybe_lock (void *v) } while (clib_atomic_test_and_set (&h->lock)) - ; + CLIB_PAUSE (); h->owner_cpu = my_cpu; h->recursion_count = 1; |