GNUnet 0.21.0
GNUNET_SCHEDULER_Task Struct Reference

Entry in list of pending tasks. More...

Collaboration diagram for GNUNET_SCHEDULER_Task:
[legend]

Data Fields

struct GNUNET_SCHEDULER_Tasknext
 This is a linked list. More...
 
struct GNUNET_SCHEDULER_Taskprev
 This is a linked list. More...
 
GNUNET_SCHEDULER_TaskCallback callback
 Function to run when ready. More...
 
void * callback_cls
 Closure for the callback. More...
 
struct GNUNET_SCHEDULER_FdInfofds
 Information about which FDs are ready for this task (and why). More...
 
struct GNUNET_SCHEDULER_FdInfo fdx
 Storage location used for fds if we want to avoid a separate malloc() call in the common case that this task is only about a single FD. More...
 
unsigned int fds_len
 Size of the fds array. More...
 
int own_handles
 Do we own the network and file handles referenced by the FdInfo structs in the fds array. More...
 
struct GNUNET_TIME_Absolute timeout
 Absolute timeout value for the task, or GNUNET_TIME_UNIT_FOREVER_ABS for "no timeout". More...
 
enum GNUNET_SCHEDULER_Reason reason
 Why is the task ready? Set after task is added to ready queue. More...
 
enum GNUNET_SCHEDULER_Priority priority
 Task priority. More...
 
int read_fd
 Set if we only wait for reading from a single FD, otherwise -1. More...
 
int write_fd
 Set if we only wait for writing to a single FD, otherwise -1. More...
 
int lifeness
 Should the existence of this task in the queue be counted as reason to not shutdown the scheduler? More...
 
int on_shutdown
 Is this task run on shutdown? More...
 
int in_ready_list
 Is this task in the ready list? More...
 
struct GNUNET_AsyncScopeSave scope
 Asynchronous scope of the task that scheduled this scope,. More...
 

Detailed Description

Entry in list of pending tasks.

Definition at line 135 of file scheduler.c.

Field Documentation

◆ next

◆ prev

struct GNUNET_SCHEDULER_Task* GNUNET_SCHEDULER_Task::prev

This is a linked list.

Definition at line 145 of file scheduler.c.

Referenced by GNUNET_SCHEDULER_add_at_with_priority().

◆ callback

◆ callback_cls

◆ fds

struct GNUNET_SCHEDULER_FdInfo* GNUNET_SCHEDULER_Task::fds

Information about which FDs are ready for this task (and why).

Definition at line 160 of file scheduler.c.

Referenced by destroy_task(), driver_add_multiple(), GNUNET_SCHEDULER_cancel(), GNUNET_SCHEDULER_do_work(), and init_fd_info().

◆ fdx

struct GNUNET_SCHEDULER_FdInfo GNUNET_SCHEDULER_Task::fdx

Storage location used for fds if we want to avoid a separate malloc() call in the common case that this task is only about a single FD.

Definition at line 167 of file scheduler.c.

Referenced by init_fd_info().

◆ fds_len

unsigned int GNUNET_SCHEDULER_Task::fds_len

Size of the fds array.

Definition at line 172 of file scheduler.c.

Referenced by destroy_task(), driver_add_multiple(), GNUNET_SCHEDULER_do_work(), and init_fd_info().

◆ own_handles

int GNUNET_SCHEDULER_Task::own_handles

Do we own the network and file handles referenced by the FdInfo structs in the fds array.

This will only be GNUNET_YES if the task was created by the GNUNET_SCHEDULER_add_select function.

Definition at line 179 of file scheduler.c.

Referenced by destroy_task(), and GNUNET_SCHEDULER_add_select().

◆ timeout

◆ reason

enum GNUNET_SCHEDULER_Reason GNUNET_SCHEDULER_Task::reason

Why is the task ready? Set after task is added to ready queue.

Initially set to zero. All reasons that have already been satisfied (e.g. read or write ready) will be set over time.

Definition at line 199 of file scheduler.c.

Referenced by get_timeout(), GNUNET_SCHEDULER_add_with_reason_and_priority(), GNUNET_SCHEDULER_do_work(), GNUNET_SCHEDULER_shutdown(), and GNUNET_SCHEDULER_task_ready().

◆ priority

◆ read_fd

int GNUNET_SCHEDULER_Task::read_fd

Set if we only wait for reading from a single FD, otherwise -1.

Definition at line 209 of file scheduler.c.

Referenced by GNUNET_SCHEDULER_add_at_with_priority(), GNUNET_SCHEDULER_add_now(), GNUNET_SCHEDULER_add_shutdown(), GNUNET_SCHEDULER_add_with_reason_and_priority(), and init_fd_info().

◆ write_fd

int GNUNET_SCHEDULER_Task::write_fd

Set if we only wait for writing to a single FD, otherwise -1.

Definition at line 214 of file scheduler.c.

Referenced by GNUNET_SCHEDULER_add_at_with_priority(), GNUNET_SCHEDULER_add_now(), GNUNET_SCHEDULER_add_shutdown(), GNUNET_SCHEDULER_add_with_reason_and_priority(), and init_fd_info().

◆ lifeness

int GNUNET_SCHEDULER_Task::lifeness

◆ on_shutdown

int GNUNET_SCHEDULER_Task::on_shutdown

Is this task run on shutdown?

Definition at line 225 of file scheduler.c.

Referenced by GNUNET_SCHEDULER_add_now(), GNUNET_SCHEDULER_add_shutdown(), and GNUNET_SCHEDULER_cancel().

◆ in_ready_list

int GNUNET_SCHEDULER_Task::in_ready_list

◆ scope

struct GNUNET_AsyncScopeSave GNUNET_SCHEDULER_Task::scope

The documentation for this struct was generated from the following file: