Joyce Kong da126627de examples/performance-thread: use compiler atomics for sync
Convert rte_atomic usages to compiler atomic built-ins
for thread sync.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
2021-10-19 17:15:57 +02:00

32 lines
565 B
C

/* SPDX-License-Identifier: BSD-3-Clause
* Copyright(c) 2015 Intel Corporation
*/
#ifndef LTHREAD_MUTEX_H_
#define LTHREAD_MUTEX_H_
#ifdef __cplusplus
extern "C" {
#endif
#include "lthread_queue.h"
#define MAX_MUTEX_NAME_SIZE 64
struct lthread_mutex {
struct lthread *owner;
uint64_t count;
struct lthread_queue *blocked __rte_cache_aligned;
struct lthread_sched *root_sched;
char name[MAX_MUTEX_NAME_SIZE];
uint64_t diag_ref; /* optional ref to user diag data */
} __rte_cache_aligned;
#ifdef __cplusplus
}
#endif
#endif /* LTHREAD_MUTEX_H_ */