Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Horizontal (nSessions) scaling draft
[vpp.git]
/
src
/
svm
/
ssvm.h
diff --git
a/src/svm/ssvm.h
b/src/svm/ssvm.h
index
bccfc16
..
8466e15
100644
(file)
--- a/
src/svm/ssvm.h
+++ b/
src/svm/ssvm.h
@@
-101,6
+101,15
@@
ssvm_lock (ssvm_shared_header_t * h, u32 my_pid, u32 tag)
h->tag = tag;
}
h->tag = tag;
}
+always_inline void
+ssvm_lock_non_recursive (ssvm_shared_header_t * h, u32 tag)
+{
+ while (__sync_lock_test_and_set (&h->lock, 1))
+ ;
+
+ h->tag = tag;
+}
+
always_inline void
ssvm_unlock (ssvm_shared_header_t * h)
{
always_inline void
ssvm_unlock (ssvm_shared_header_t * h)
{
@@
-113,6
+122,14
@@
ssvm_unlock (ssvm_shared_header_t * h)
}
}
}
}
+always_inline void
+ssvm_unlock_non_recursive (ssvm_shared_header_t * h)
+{
+ h->tag = 0;
+ CLIB_MEMORY_BARRIER ();
+ h->lock = 0;
+}
+
static inline void *
ssvm_push_heap (ssvm_shared_header_t * sh)
{
static inline void *
ssvm_push_heap (ssvm_shared_header_t * sh)
{