Changes between Initial Version and Version 1 of Ticket #37


Ignore:
Timestamp:
Jun 16, 2010, 4:23:30 PM (14 years ago)
Author:
Nicolas Pouillon
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #37

    • Property Owner changed from Nicolas Pouillon to becoulet
    • Property Priority changed from major to minor
    • Property Component changed from Build system to mutek
    • Property Type changed from defect to enhancement
  • Ticket #37 – Description

    initial v1  
    66#!c
    77
     8// Skipped GPCT stuff to declare a queue as "worker_internal".
     9
     10/**
     11 @this is an item pushable to a worker queue.
     12 */
     13struct 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
    825/**
    926 @this is a worker function type definition.
     
    1128 Function must return once it handled the reason of wakeup.
    1229 */
    13 typedef void worker_func_t(void *param);
     30typedef void worker_func_t(struct worker_item_s *item, void *priv);
    1431
    1532struct worker_thread_s
    1633{
    1734    worker_func_t *func;
    18     void *param;
    19     // lock, whatever
     35    void *priv;
     36    // lock, queue, whatever
    2037};
    2138
     
    2340void worker_thread_init(struct worker_thread_s*,
    2441                        worker_func_t *func,
    25                         void *param);
     42                        void *func_priv);
    2643
    2744/**
     
    4158 calls to this function yields multiple consecutive calls to
    4259 the worker function.
     60
     61 @param item The item to pass to the woken-up function
    4362 */
    44 void worker_thread_wakeup(struct worker_thread_s*);
     63void worker_thread_wakeup(struct worker_thread_s*, struct worker_item_s *item);
    4564}}}
    4665
    4766Open 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