@@ -110,8 +110,16 @@ typedef void (*odp_abort_func_t)(void) ODP_NORETURN;
* @note It is expected that all unassigned members are zero
*/
typedef struct odp_init_t {
- odp_log_func_t log_fn; /**< Replacement for the default log fn */
- odp_abort_func_t abort_fn; /**< Replacement for the default abort fn */
+ /** Maximum number of worker threads the user will run concurrently.
+ Valid range is from 0 to platform specific maximum. */
+ int num_worker;
+ /** Maximum number of control threads the user will run concurrently.
+ Valid range is from 0 to platform specific maximum. */
+ int num_control;
+ /** Replacement for the default log fn */
+ odp_log_func_t log_fn;
+ /** Replacement for the default abort fn */
+ odp_abort_func_t abort_fn;
} odp_init_t;
Why not add the new parameters at the end of the struct? That way we're at least making an attempt at backwards compatibility (something we need to be thinking about going forward). I'd also have the convention that if either num_worker or num_control are 0 this means application is providing no hints and implementation defaults should apply for these values. That way when odp_init_init() is called to initialize this struct (which also should be added) we're future-proofed.