Daemons
| Member Type | Member Name |
|---|---|
struct list_head | list_node |
bool | background |
struct thread | *thread |
struct daemon | *daemon |
atomic_bool | executing_work |
enum daemon_thread_command | command |
| Member Type | Member Name |
|---|---|
daemon_fn | function |
struct work_args | args |
struct daemon | *daemon |
void | *private |
| Member Type | Member Name |
|---|---|
size_t | max_timesharing_threads |
atomic_size_t | timesharing_threads |
atomic_size_t | idle_timesharing_threads |
atomic_bool | background_thread_present |
int64_t | thread_cpu |
enum daemon_flags | flags |
| Name | Value |
|---|---|
DAEMON_THREAD_COMMAND_NONE | None |
DAEMON_THREAD_COMMAND_EXIT | None |
DAEMON_THREAD_COMMAND_RESTART | None |
DAEMON_THREAD_COMMAND_SLEEP | None |
DAEMON_THREAD_COMMAND_DEFAULT | DAEMON_THREAD_COMMAND_SLEEP |
| Name | Value |
|---|---|
DAEMON_FLAG_HAS_WORKQUEUE | 1 |
DAEMON_FLAG_HAS_NAME | 1 << 1 |
DAEMON_FLAG_AUTO_SPAWN | 1 << 2 |
DAEMON_FLAG_NO_TS_THREADS | 1 << 3 |
DAEMON_FLAG_UNMIGRATABLE_THREADS | 1 << 4 |
DAEMON_FLAG_NONE | 0 |
| Name | Value |
|---|---|
DAEMON_STATE_ACTIVE | None |
DAEMON_STATE_DESTROYING | None |
DAEMON_STATE_DEAD | None |
type alias
Section titled “type alias”(*daemon_fn) : enum daemon_thread_command (struct daemon_work *work, struct daemon_thread *executor, void *arg, void *arg2)
static inline const char *daemon_state_str(enum daemon_states)struct daemon *daemon_create(struct daemon_attributes*attrs,struct daemon_work*timesharing_work,struct daemon_work*background_work,struct workqueue_attributes*wq_attrs,char *fmt)voiddaemon_destroy(struct daemon*daemon)struct daemon_thread *daemon_spawn_worker(struct daemon*daemon)enum workqueue_errordaemon_submit_oneshot_work(struct daemon*daemon,work_function func,struct work_argsargs)enum workqueue_errordaemon_submit_work(struct daemon*daemon,struct work*work)voiddaemon_print(struct daemon*daemon)voiddaemon_wake_background_worker(struct daemon*daemon)voiddaemon_wake_timesharing_worker(struct daemon*daemon)