Changeset 8119363 in mainline for uspace/lib/c/include/fibril.h
- Timestamp:
- 2018-06-26T17:35:40Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6e569bf
- Parents:
- fbfe59d (diff), e768aea (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/fibril.h
rfbfe59d r8119363 36 36 #define LIBC_FIBRIL_H_ 37 37 38 #include <context.h>39 38 #include <types/common.h> 40 #include <adt/list.h>41 #include <libarch/tls.h>42 39 43 #define FIBRIL_WRITER 1 44 45 struct fibril; 40 typedef struct fibril fibril_t; 46 41 47 42 typedef struct { 48 struct fibril*owned_by;43 fibril_t *owned_by; 49 44 } fibril_owner_info_t; 50 45 51 typedef enum {52 FIBRIL_PREEMPT,53 FIBRIL_TO_MANAGER,54 FIBRIL_FROM_MANAGER,55 FIBRIL_FROM_DEAD56 } fibril_switch_type_t;57 58 46 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;75 47 76 48 /** Fibril-local variable specifier */ … … 81 53 extern fid_t fibril_create_generic(errno_t (*func)(void *), void *arg, size_t); 82 54 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);86 55 extern void fibril_add_ready(fid_t fid); 87 extern void fibril_add_manager(fid_t fid);88 extern void fibril_remove_manager(void);89 56 extern fid_t fibril_get_id(void); 57 extern void fibril_yield(void); 90 58 91 59 static inline fid_t fibril_create(errno_t (*func)(void *), void *arg) … … 94 62 } 95 63 96 static inline int fibril_yield(void)97 {98 return fibril_switch(FIBRIL_PREEMPT);99 }100 101 64 #endif 102 65
Note:
See TracChangeset
for help on using the changeset viewer.