lfn
serial
ticket/834-toolchain-update
topic/msim-upgrade
topic/simplify-dev-export
Last change
on this file since 0d56712 was 0d56712, checked in by Adam Hraska <adam.hraska+hos@…>, 13 years ago |
workq: Added magic cookie integrity checks. Fixed test workqueue1.
|
-
Property mode
set to
100644
|
File size:
1.2 KB
|
Line | |
---|
1 |
|
---|
2 | #ifndef KERN_WORKQUEUE_H_
|
---|
3 | #define KERN_WORKQUEUE_H_
|
---|
4 |
|
---|
5 | #include <adt/list.h>
|
---|
6 | #include <proc/thread.h>
|
---|
7 |
|
---|
8 | /* Fwd decl. */
|
---|
9 | struct work_item;
|
---|
10 | struct work_queue;
|
---|
11 | typedef struct work_queue work_queue_t;
|
---|
12 |
|
---|
13 | typedef void (*work_func_t)(struct work_item *);
|
---|
14 |
|
---|
15 | typedef struct work_item {
|
---|
16 | link_t queue_link;
|
---|
17 | work_func_t func;
|
---|
18 |
|
---|
19 | #ifdef CONFIG_DEBUG
|
---|
20 | /* Magic number for integrity checks. */
|
---|
21 | uint32_t cookie;
|
---|
22 | #endif
|
---|
23 | } work_t;
|
---|
24 |
|
---|
25 |
|
---|
26 |
|
---|
27 | extern void workq_global_init(void);
|
---|
28 | extern void workq_global_worker_init(void);
|
---|
29 | extern void workq_global_stop(void);
|
---|
30 | extern int workq_global_enqueue_noblock(work_t *, work_func_t);
|
---|
31 | extern int workq_global_enqueue(work_t *, work_func_t);
|
---|
32 |
|
---|
33 | extern struct work_queue * workq_create(const char *);
|
---|
34 | extern void workq_destroy(struct work_queue *);
|
---|
35 | extern int workq_init(struct work_queue *, const char *);
|
---|
36 | extern void workq_stop(struct work_queue *);
|
---|
37 | extern int workq_enqueue_noblock(struct work_queue *, work_t *, work_func_t);
|
---|
38 | extern int workq_enqueue(struct work_queue *, work_t *, work_func_t);
|
---|
39 |
|
---|
40 | extern void workq_print_info(struct work_queue *);
|
---|
41 | extern void workq_global_print_info(void);
|
---|
42 |
|
---|
43 |
|
---|
44 | extern void workq_after_thread_ran(void);
|
---|
45 | extern void workq_before_thread_is_ready(thread_t *);
|
---|
46 |
|
---|
47 | #endif /* KERN_WORKQUEUE_H_ */
|
---|
Note:
See
TracBrowser
for help on using the repository browser.