pub unsafe extern "C" fn esp_pthread_set_cfg(
cfg: *const esp_pthread_cfg_t,
) -> esp_err_t
Expand description
@brief Configure parameters for creating pthread
This API allows you to configure how the subsequent pthread_create() call will behave. This call can be used to setup configuration parameters like stack size, priority, configuration inheritance etc.
If the ‘inherit’ flag in the configuration structure is enabled, then the same configuration is also inherited in the thread subtree.
@note If cfg->stack_alloc_caps is 0, it is automatically set to valid default stack memory capabilities. If cfg->stack_alloc_caps is non-zero, the developer is responsible for its correctenss. This function only checks that the capabilities are MALLOC_CAP_8BIT, the rest is unchecked. @note Passing non-NULL attributes to pthread_create() will override the stack_size parameter set using this API
@param cfg The pthread config parameters
@return - ESP_OK if configuration was successfully set - ESP_ERR_NO_MEM if out of memory - ESP_ERR_INVALID_ARG if stack_size is less than PTHREAD_STACK_MIN - ESP_ERR_INVALID_ARG if stack_alloc_caps does not include MALLOC_CAP_8BIT