docs: fix esp_pthread example syntax error

This commit is contained in:
Felipe Neves
2020-01-02 13:58:29 -03:00
parent 97c8b90083
commit e5e8ee8912

View File

@@ -13,11 +13,15 @@ This module offers Espressif specific extensions to the pthread library that can
Example to tune the stack size of the pthread:
.. highlight:: c
.. code-block:: c
::
void * thread_func(void * p)
{
printf("In thread_func\n");
return NULL;
}
main()
void app_main(void)
{
pthread_t t1;
@@ -30,14 +34,14 @@ Example to tune the stack size of the pthread:
The API can also be used for inheriting the settings across threads. For example:
.. highlight:: c
::
.. code-block:: c
void * my_thread2(void * p)
{
/* This thread will inherit the stack size of 4K */
printf("In my_thread2\n");
return NULL;
}
void * my_thread1(void * p)
@@ -45,11 +49,12 @@ The API can also be used for inheriting the settings across threads. For example
printf("In my_thread1\n");
pthread_t t2;
pthread_create(&t2, NULL, my_thread2);
return NULL;
}
main()
void app_main(void)
{
pthread_t t1;
esp_pthread_cfg_t cfg = esp_create_default_pthread_config();