Changeset bc1f1c2 in mainline for uspace/lib/libc/include/fibril.h
- Timestamp:
- 2007-06-28T00:54:12Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 12f91130
- Parents:
- b9641ee
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libc/include/fibril.h
rb9641ee rbc1f1c2 33 33 */ 34 34 35 #ifndef LIBC_ PSTHREAD_H_36 #define LIBC_ PSTHREAD_H_35 #ifndef LIBC_FIBRIL_H_ 36 #define LIBC_FIBRIL_H_ 37 37 38 #include <libarch/ psthread.h>38 #include <libarch/fibril.h> 39 39 #include <libadt/list.h> 40 40 #include <libarch/thread.h> … … 47 47 #endif /* context_set */ 48 48 49 #define PSTHREAD_SERIALIZED 149 #define FIBRIL_SERIALIZED 1 50 50 51 51 typedef enum { 52 PS_SLEEP,53 PS_PREEMPT,54 PS_TO_MANAGER,55 PS_FROM_MANAGER,56 PS_FROM_DEAD57 } pschange_type;52 FIBRIL_SLEEP, 53 FIBRIL_PREEMPT, 54 FIBRIL_TO_MANAGER, 55 FIBRIL_FROM_MANAGER, 56 FIBRIL_FROM_DEAD 57 } fibril_switch_type_t; 58 58 59 typedef sysarg_t pstid_t;59 typedef sysarg_t fid_t; 60 60 61 struct psthread_data{61 struct fibril { 62 62 link_t link; 63 63 context_t ctx; … … 67 67 tcb_t *tcb; 68 68 69 struct psthread_data*clean_after_me;70 struct psthread_data*joiner;69 struct fibril *clean_after_me; 70 struct fibril *joiner; 71 71 int joinee_retval; 72 72 int retval; 73 73 int flags; 74 74 }; 75 typedef struct psthread_data psthread_data_t;75 typedef struct fibril fibril_t; 76 76 77 77 extern int context_save(context_t *c); 78 78 extern void context_restore(context_t *c) __attribute__ ((noreturn)); 79 79 80 pstid_t psthread_create(int (*func)(void *), void *arg);81 int psthread_join(pstid_t psthrid);82 psthread_data_t * psthread_setup(void);83 void psthread_teardown(psthread_data_t *pt);84 int psthread_schedule_next_adv(pschange_type ctype);85 void psthread_add_ready(pstid_t ptid);86 void psthread_add_manager(pstid_t psthrid);87 void psthread_remove_manager(void);88 pstid_t psthread_get_id(void);89 void psthread_inc_sercount(void);90 void psthread_dec_sercount(void);80 extern fid_t fibril_create(int (*func)(void *), void *arg); 81 extern int fibril_join(fid_t fid); 82 extern fibril_t *fibril_setup(void); 83 extern void fibril_teardown(fibril_t *f); 84 extern int fibril_schedule_next_adv(fibril_switch_type_t stype); 85 extern void fibril_add_ready(fid_t fid); 86 extern void fibril_add_manager(fid_t fid); 87 extern void fibril_remove_manager(void); 88 extern fid_t fibril_get_id(void); 89 extern void fibril_inc_sercount(void); 90 extern void fibril_dec_sercount(void); 91 91 92 static inline int psthread_schedule_next(void) {93 return psthread_schedule_next_adv(PS_PREEMPT);92 static inline int fibril_schedule_next(void) { 93 return fibril_schedule_next_adv(FIBRIL_PREEMPT); 94 94 } 95 95
Note:
See TracChangeset
for help on using the changeset viewer.