Changes between Initial Version and Version 1 of Ticket #37
- Timestamp:
- Jun 16, 2010, 4:23:30 PM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #37
- Property Owner changed from Nicolas Pouillon to becoulet
-
Property
Priority
changed from
major
tominor
-
Property
Component
changed from
Build system
tomutek
-
Property
Type
changed from
defect
toenhancement
-
Ticket #37 – Description
initial v1 6 6 #!c 7 7 8 // Skipped GPCT stuff to declare a queue as "worker_internal". 9 10 /** 11 @this is an item pushable to a worker queue. 12 */ 13 struct worker_item_s 14 { 15 worker_internal_item_t item; 16 }; 17 18 19 /** 20 @this permits to retrieve an actual structure from an item 21 pointer 22 */ 23 #define WORKER_ITEM_TO_STRUCT(struct_type, field, item) 24 8 25 /** 9 26 @this is a worker function type definition. … … 11 28 Function must return once it handled the reason of wakeup. 12 29 */ 13 typedef void worker_func_t( void *param);30 typedef void worker_func_t(struct worker_item_s *item, void *priv); 14 31 15 32 struct worker_thread_s 16 33 { 17 34 worker_func_t *func; 18 void *p aram;19 // lock, whatever35 void *priv; 36 // lock, queue, whatever 20 37 }; 21 38 … … 23 40 void worker_thread_init(struct worker_thread_s*, 24 41 worker_func_t *func, 25 void * param);42 void *func_priv); 26 43 27 44 /** … … 41 58 calls to this function yields multiple consecutive calls to 42 59 the worker function. 60 61 @param item The item to pass to the woken-up function 43 62 */ 44 void worker_thread_wakeup(struct worker_thread_s* );63 void worker_thread_wakeup(struct worker_thread_s*, struct worker_item_s *item); 45 64 }}} 46 65 47 66 Open questions: 48 * Add a void* parameter to wakeup, which would be passed to func ? 49 * Allow function to sucide context 67 * Allow function to sucide worker context