Changeset 514d561 in mainline for uspace/lib/c/generic/private
- Timestamp:
- 2018-07-20T16:27:20Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 05208d9
- Parents:
- 7137f74c
- git-author:
- Jiří Zárevúcky <jiri.zarevucky@…> (2018-07-19 21:52:47)
- git-committer:
- Jiří Zárevúcky <jiri.zarevucky@…> (2018-07-20 16:27:20)
- Location:
- uspace/lib/c/generic/private
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/private/async.h
r7137f74c r514d561 42 42 #include <sys/time.h> 43 43 #include <stdbool.h> 44 45 /** Structures of this type are used to track the timeout events. */46 typedef struct {47 /** If true, this struct is in the timeout list. */48 bool inlist;49 50 /** Timeout list link. */51 link_t link;52 53 /** If true, we have timed out. */54 bool occurred;55 56 /** Expiration time. */57 struct timeval expires;58 } to_event_t;59 60 /** Structures of this type are used to track the wakeup events. */61 typedef struct {62 /** If true, this struct is in a synchronization object wait queue. */63 bool inlist;64 65 /** Wait queue linkage. */66 link_t link;67 } wu_event_t;68 69 /** Structures of this type represent a waiting fibril. */70 typedef struct {71 /** Identification of and link to the waiting fibril. */72 fid_t fid;73 74 /** If true, this fibril is currently active. */75 bool active;76 77 /** Timeout wait data. */78 to_event_t to_event;79 /** Wakeup wait data. */80 wu_event_t wu_event;81 } awaiter_t;82 44 83 45 /** Session data */ … … 132 94 }; 133 95 134 extern void awaiter_initialize(awaiter_t *);135 136 96 extern void __async_server_init(void); 137 97 extern void __async_client_init(void); 138 98 extern void __async_ports_init(void); 139 extern void async_insert_timeout(awaiter_t *);140 99 141 100 extern errno_t async_create_port_internal(iface_t, async_port_handler_t, -
uspace/lib/c/generic/private/fibril.h
r7137f74c r514d561 42 42 context_t ctx; 43 43 44 uspace_arg_t uarg; 44 45 link_t link; 45 46 void *stack; 47 size_t stack_size; 46 48 void *arg; 47 49 errno_t (*func)(void *); … … 51 53 errno_t retval; 52 54 53 fibril_ owner_info_t *waits_for;55 fibril_t *thread_ctx; 54 56 55 atomic_t futex_locks;57 bool is_running : 1; 56 58 bool is_writer : 1; 57 59 /* In some places, we use fibril structs that can't be freed. */ 58 60 bool is_freeable : 1; 61 62 /* Debugging stuff. */ 63 atomic_t futex_locks; 64 fibril_owner_info_t *waits_for; 65 fibril_event_t *sleep_event; 59 66 }; 60 61 typedef enum {62 FIBRIL_PREEMPT,63 FIBRIL_FROM_BLOCKED,64 FIBRIL_FROM_MANAGER,65 FIBRIL_FROM_DEAD66 } fibril_switch_type_t;67 67 68 68 extern fibril_t *fibril_alloc(void); 69 69 extern void fibril_setup(fibril_t *); 70 extern void fibril_teardown(fibril_t *f, bool locked); 71 extern int fibril_switch(fibril_switch_type_t stype); 72 extern void fibril_add_manager(fid_t fid); 73 extern void fibril_remove_manager(void); 70 extern void fibril_teardown(fibril_t *f); 74 71 extern fibril_t *fibril_self(void); 75 72 73 extern void __fibrils_init(void); 74 76 75 #endif
Note:
See TracChangeset
for help on using the changeset viewer.