Changes in uspace/lib/c/include/fibril.h [d73d992:3b1cc8d] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/fibril.h
rd73d992 r3b1cc8d 36 36 #define LIBC_FIBRIL_H_ 37 37 38 #include <context.h> 38 39 #include <types/common.h> 40 #include <adt/list.h> 41 #include <libarch/tls.h> 39 42 40 typedef struct fibril fibril_t; 43 #define FIBRIL_WRITER 1 44 45 struct fibril; 41 46 42 47 typedef struct { 43 fibril_t*owned_by;48 struct fibril *owned_by; 44 49 } fibril_owner_info_t; 45 50 51 typedef enum { 52 FIBRIL_PREEMPT, 53 FIBRIL_TO_MANAGER, 54 FIBRIL_FROM_MANAGER, 55 FIBRIL_FROM_DEAD 56 } fibril_switch_type_t; 57 46 58 typedef sysarg_t fid_t; 59 60 typedef struct fibril { 61 link_t link; 62 link_t all_link; 63 context_t ctx; 64 void *stack; 65 void *arg; 66 errno_t (*func)(void *); 67 tcb_t *tcb; 68 69 struct fibril *clean_after_me; 70 errno_t retval; 71 int flags; 72 73 fibril_owner_info_t *waits_for; 74 } fibril_t; 47 75 48 76 /** Fibril-local variable specifier */ … … 53 81 extern fid_t fibril_create_generic(errno_t (*func)(void *), void *arg, size_t); 54 82 extern void fibril_destroy(fid_t fid); 83 extern fibril_t *fibril_setup(void); 84 extern void fibril_teardown(fibril_t *f, bool locked); 85 extern int fibril_switch(fibril_switch_type_t stype); 55 86 extern void fibril_add_ready(fid_t fid); 87 extern void fibril_add_manager(fid_t fid); 88 extern void fibril_remove_manager(void); 56 89 extern fid_t fibril_get_id(void); 57 extern void fibril_yield(void);58 90 59 91 static inline fid_t fibril_create(errno_t (*func)(void *), void *arg) … … 62 94 } 63 95 96 static inline int fibril_yield(void) 97 { 98 return fibril_switch(FIBRIL_PREEMPT); 99 } 100 64 101 #endif 65 102
Note:
See TracChangeset
for help on using the changeset viewer.