]> git.proxmox.com Git - ceph.git/blame - ceph/src/seastar/dpdk/examples/performance-thread/common/lthread.h
import 15.2.0 Octopus source
[ceph.git] / ceph / src / seastar / dpdk / examples / performance-thread / common / lthread.h
CommitLineData
7c673cae 1/*
9f95a23c
TL
2 * SPDX-License-Identifier: BSD-3-Clause
3 * Copyright 2015 Intel Corporation.
4 * Copyright 2012 Hasan Alayli <halayli@gmail.com>
7c673cae 5 */
7c673cae
FG
6#ifndef LTHREAD_H_
7#define LTHREAD_H_
8
11fdf7f2
TL
9#ifdef __cplusplus
10extern "C" {
11#endif
12
7c673cae
FG
13#include <rte_per_lcore.h>
14
15#include "lthread_api.h"
16#include "lthread_diag.h"
17
18struct lthread;
19struct lthread_sched;
20
21/* function to be called when a context function returns */
22typedef void (*lthread_exit_func) (struct lthread *);
23
24void _lthread_exit_handler(struct lthread *lt);
25
26void lthread_set_funcname(const char *f);
27
28void _lthread_sched_busy_sleep(struct lthread *lt, uint64_t nsecs);
29
30int _lthread_desched_sleep(struct lthread *lt);
31
32void _lthread_free(struct lthread *lt);
33
9f95a23c 34struct lthread_sched *_lthread_sched_get(unsigned int lcore_id);
7c673cae
FG
35
36struct lthread_stack *_stack_alloc(void);
37
38struct
39lthread_sched *_lthread_sched_create(size_t stack_size);
40
41void
42_lthread_init(struct lthread *lt,
43 lthread_func_t fun, void *arg, lthread_exit_func exit_handler);
44
45void _lthread_set_stack(struct lthread *lt, void *stack, size_t stack_size);
46
11fdf7f2
TL
47#ifdef __cplusplus
48}
49#endif
50
7c673cae 51#endif /* LTHREAD_H_ */