-
Notifications
You must be signed in to change notification settings - Fork 0
/
sysqos_dispatch_node.h
executable file
·62 lines (45 loc) · 1.49 KB
/
sysqos_dispatch_node.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//
// Created by root on 18-7-29.
//
#ifndef QOS_QOS_PERMISSION_ITEM_H
#define QOS_QOS_PERMISSION_ITEM_H
#include "sysqos_nodereq_list.h"
#include "sysqos_protocol.h"
#define PERMISSION_MANAGER_ITEM_TEST
#ifdef __cplusplus
extern "C" {
#endif
typedef struct dispatch_node
{
/********************************************/
/*
* return is_rest
* */
bool (*resource_changed)(struct dispatch_node *item,
dispatch2app_t *dta,
struct list_head *got_permission_list);
//返回的是获得
void
(*free_resource)(struct dispatch_node *item, resource_list_t *rs,
struct list_head *got_permission_list);
//失败则放入队列
int (*alloc_resource)(struct dispatch_node *item,
resource_list_t *rs);
void
(*get_protocol)(struct dispatch_node *item, app2dispatch_t *atd);
void (*pop_all)(struct dispatch_node *item,
struct list_head *fail_permission_list);
void (*reset)(struct dispatch_node *item);
/********************************************/
dispatch_base_node_t base_node;
nodereq_list_t lhead_nodereq;
pthread_spinlock_t lck;
int fence_id;
} dispatch_node_t;
int dispatch_node_init(dispatch_node_t *item, int version);
void dispatch_node_exit(dispatch_node_t *item);
void test_dispatch_node();
#ifdef __cplusplus
}
#endif
#endif //TEST_QOS_QOS_PERMISSION_ITEM_H