2019-06-25 11:12:58 +00:00
|
|
|
/* SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
* Copyright(c) 2015 Intel Corporation
|
2017-04-21 10:43:26 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef LTHREAD_MUTEX_H_
|
|
|
|
#define LTHREAD_MUTEX_H_
|
|
|
|
|
2018-05-15 09:49:22 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2017-04-21 10:43:26 +00:00
|
|
|
#include "lthread_queue.h"
|
|
|
|
|
|
|
|
|
|
|
|
#define MAX_MUTEX_NAME_SIZE 64
|
|
|
|
|
|
|
|
struct lthread_mutex {
|
|
|
|
struct lthread *owner;
|
|
|
|
rte_atomic64_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;
|
|
|
|
|
2018-05-15 09:49:22 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2017-04-21 10:43:26 +00:00
|
|
|
#endif /* LTHREAD_MUTEX_H_ */
|