mirror of
https://github.com/espressif/esp-idf.git
synced 2025-11-15 17:36:38 +00:00
pthread : Add support for attributes and few APIs
This introduces the following changes :
* Implmentation added for pthread attribute related functions :
* pthread_attr_init
* pthread_attr_destroy
* pthread_attr_setdetachstate
* pthread_attr_getdetachstate
* pthread_attr_getstacksize
* pthread_attr_setstacksize
* pthread_create now supports passing attributes/configs through pthread_attr_t structure
* pthread_mutex_timedlock added
* pthread_exit added
* memory for joinable thread is freed before returning from pthread_join
This commit is contained in:
@@ -18,7 +18,9 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <pthread.h>
|
||||
#ifndef PTHREAD_STACK_MIN
|
||||
#define PTHREAD_STACK_MIN CONFIG_PTHREAD_STACK_MIN
|
||||
#endif
|
||||
|
||||
/** pthread configuration structure that influences pthread creation */
|
||||
typedef struct {
|
||||
@@ -39,11 +41,15 @@ typedef struct {
|
||||
* then the same configuration is also inherited in the thread
|
||||
* subtree.
|
||||
*
|
||||
* @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_t esp_pthread_set_cfg(const esp_pthread_cfg_t *cfg);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user