docs: update format issues for EN and CN files under api-reference/system and...
This commit is contained in:
@@ -23,7 +23,7 @@ Unlike many operating systems using POSIX Threads, ESP-IDF is a real-time operat
|
||||
|
||||
By default, all POSIX Threads have the same RTOS priority, but it is possible to change this by calling a :ref:`custom API <esp-pthread>`.
|
||||
|
||||
Standard features
|
||||
Standard Features
|
||||
-----------------
|
||||
|
||||
The following standard APIs are implemented in ESP-IDF.
|
||||
@@ -51,7 +51,7 @@ Thread Attributes
|
||||
|
||||
* ``pthread_attr_init()``
|
||||
* ``pthread_attr_destroy()``
|
||||
- This function doesn't need to free any resources and instead resets the ``attr`` structure to defaults (implementation is same as ``pthread_attr_init()``).
|
||||
- This function does not need to free any resources and instead resets the ``attr`` structure to defaults (implementation is same as ``pthread_attr_init()``).
|
||||
* ``pthread_attr_getstacksize()`` / ``pthread_attr_setstacksize()``
|
||||
* ``pthread_attr_getdetachstate()`` / ``pthread_attr_setdetachstate()``
|
||||
|
||||
@@ -62,7 +62,9 @@ Once
|
||||
|
||||
Static initializer constant ``PTHREAD_ONCE_INIT`` is supported.
|
||||
|
||||
.. note:: This function can be called from tasks created using either pthread or FreeRTOS APIs
|
||||
.. note::
|
||||
|
||||
This function can be called from tasks created using either pthread or FreeRTOS APIs
|
||||
|
||||
Mutexes
|
||||
^^^^^^^
|
||||
@@ -81,7 +83,9 @@ POSIX Mutexes are implemented as FreeRTOS Mutex Semaphores (normal type for "fas
|
||||
|
||||
Static initializer constant ``PTHREAD_MUTEX_INITIALIZER`` is supported, but the non-standard static initializer constants for other mutex types are not supported.
|
||||
|
||||
.. note:: These functions can be called from tasks created using either pthread or FreeRTOS APIs
|
||||
.. note::
|
||||
|
||||
These functions can be called from tasks created using either pthread or FreeRTOS APIs
|
||||
|
||||
Condition Variables
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
@@ -98,12 +102,14 @@ Static initializer constant ``PTHREAD_COND_INITIALIZER`` is supported.
|
||||
|
||||
* The resolution of ``pthread_cond_timedwait()`` timeouts is the RTOS tick period (see :ref:`CONFIG_FREERTOS_HZ`). Timeouts may be delayed up to one tick period after the requested timeout.
|
||||
|
||||
.. note:: These functions can be called from tasks created using either pthread or FreeRTOS APIs
|
||||
.. note::
|
||||
|
||||
These functions can be called from tasks created using either pthread or FreeRTOS APIs
|
||||
|
||||
Semaphores
|
||||
^^^^^^^^^^
|
||||
|
||||
In IDF, POSIX *unnamed* semaphores are implemented. The accessible API is described below. It implements `semaphores as specified in the POSIX standard <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/semaphore.h.html>`_, unless specified otherwise.
|
||||
In ESP-IDF, POSIX **unnamed** semaphores are implemented. The accessible API is described below. It implements `semaphores as specified in the POSIX standard <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/semaphore.h.html>`_, unless specified otherwise.
|
||||
|
||||
* `sem_init() <https://pubs.opengroup.org/onlinepubs/9699919799/functions/sem_init.html>`_
|
||||
* `sem_destroy() <https://pubs.opengroup.org/onlinepubs/9699919799/functions/sem_destroy.html>`_
|
||||
@@ -112,14 +118,14 @@ In IDF, POSIX *unnamed* semaphores are implemented. The accessible API is descri
|
||||
|
||||
* `sem_post() <https://pubs.opengroup.org/onlinepubs/9699919799/functions/sem_post.html>`_
|
||||
|
||||
- If the semaphore has a value of ``SEM_VALUE_MAX`` already, -1 is returned and ``errno`` is set to ``EAGAIN``.
|
||||
- If the semaphore has a value of ``SEM_VALUE_MAX`` already, ``-1`` is returned and ``errno`` is set to ``EAGAIN``.
|
||||
|
||||
* `sem_wait() <https://pubs.opengroup.org/onlinepubs/9699919799/functions/sem_wait.html>`_
|
||||
* `sem_trywait() <https://pubs.opengroup.org/onlinepubs/9699919799/functions/sem_trywait.html>`_
|
||||
* `sem_timedwait() <https://pubs.opengroup.org/onlinepubs/9699919799/functions/sem_timedwait.html>`_
|
||||
|
||||
- The time value passed by abstime will be rounded up to the next FreeRTOS tick.
|
||||
- The actual timeout will happen after the tick the time was rounded to and before the following tick.
|
||||
- The actual timeout happens after the tick the time was rounded to and before the following tick.
|
||||
- It is possible, though unlikely, that the task is preempted directly after the timeout calculation, delaying the timeout of the following blocking operating system call by the duration of the preemption.
|
||||
|
||||
* `sem_getvalue() <https://pubs.opengroup.org/onlinepubs/9699919799/functions/sem_getvalue.html>`_
|
||||
@@ -151,9 +157,13 @@ Thread-Specific Data
|
||||
* ``pthread_key_delete()``
|
||||
* ``pthread_setspecific()`` / ``pthread_getspecific()``
|
||||
|
||||
.. note:: These functions can be called from tasks created using either pthread or FreeRTOS APIs. When calling these functions from tasks created using FreeRTOS APIs, :ref:`CONFIG_FREERTOS_TLSP_DELETION_CALLBACKS` config option must be enabled to ensure the thread-specific data is cleaned up before the task is deleted.
|
||||
.. note::
|
||||
|
||||
These functions can be called from tasks created using either pthread or FreeRTOS APIs. When calling these functions from tasks created using FreeRTOS APIs, :ref:`CONFIG_FREERTOS_TLSP_DELETION_CALLBACKS` config option must be enabled to ensure the thread-specific data is cleaned up before the task is deleted.
|
||||
|
||||
.. note:: There are other options for thread local storage in ESP-IDF, including options with higher performance. See :doc:`/api-guides/thread-local-storage`.
|
||||
.. note::
|
||||
|
||||
There are other options for thread local storage in ESP-IDF, including options with higher performance. See :doc:`/api-guides/thread-local-storage`.
|
||||
|
||||
Not Implemented
|
||||
---------------
|
||||
@@ -170,7 +180,7 @@ Other POSIX Threads functions (not listed here) are not implemented and will pro
|
||||
ESP-IDF Extensions
|
||||
------------------
|
||||
|
||||
The API :cpp:func:`esp_pthread_set_cfg` defined in the ``esp_pthreads.h`` header offers custom extensions to control how subsequent calls to ``pthread_create()`` will behave. Currently, the following configuration can be set:
|
||||
The API :cpp:func:`esp_pthread_set_cfg` defined in the ``esp_pthreads.h`` header offers custom extensions to control how subsequent calls to ``pthread_create()`` behaves. Currently, the following configuration can be set:
|
||||
|
||||
.. list::
|
||||
- Default stack size of new threads, if not specified when calling ``pthread_create()`` (overrides :ref:`CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT`).
|
||||
|
||||
Reference in New Issue
Block a user