[v2,05/20] graph: annotate graph lock
Checks
Commit Message
Export internal lock and annotate associated helper.
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
lib/graph/graph.c | 10 ++++++++--
lib/graph/graph_private.h | 10 ++++++++--
2 files changed, 16 insertions(+), 4 deletions(-)
@@ -30,16 +30,22 @@ graph_list_head_get(void)
return &graph_list;
}
+rte_spinlock_t *
+graph_spinlock_get(void)
+{
+ return &graph_lock;
+}
+
void
graph_spinlock_lock(void)
{
- rte_spinlock_lock(&graph_lock);
+ rte_spinlock_lock(graph_spinlock_get());
}
void
graph_spinlock_unlock(void)
{
- rte_spinlock_unlock(&graph_lock);
+ rte_spinlock_unlock(graph_spinlock_get());
}
static int
@@ -10,6 +10,7 @@
#include <rte_common.h>
#include <rte_eal.h>
+#include <rte_spinlock.h>
#include "rte_graph.h"
#include "rte_graph_worker.h"
@@ -148,20 +149,25 @@ STAILQ_HEAD(graph_head, graph);
*/
struct graph_head *graph_list_head_get(void);
+rte_spinlock_t *
+graph_spinlock_get(void);
+
/* Lock functions */
/**
* @internal
*
* Take a lock on the graph internal spin lock.
*/
-void graph_spinlock_lock(void);
+void graph_spinlock_lock(void)
+ __rte_exclusive_lock_function(graph_spinlock_get());
/**
* @internal
*
* Release a lock on the graph internal spin lock.
*/
-void graph_spinlock_unlock(void);
+void graph_spinlock_unlock(void)
+ __rte_unlock_function(graph_spinlock_get());
/* Graph operations */
/**