diff --git a/Documentation/NuttxUserGuide.html b/Documentation/NuttxUserGuide.html index 3766eba646f..59e1b76f4f5 100644 --- a/Documentation/NuttxUserGuide.html +++ b/Documentation/NuttxUserGuide.html @@ -13,7 +13,7 @@
User's Manual
by
Gregory Nutt
-
Last Updated: July 24, 2015
+Last Updated: December 9, 2016
@@ -5424,12 +5424,15 @@ be sent.Thread Specific Data. @@ -5439,64 +5442,64 @@ be sent. (2) The main task thread does not had thread-specific data.
pthread Mutexes.
Condition Variables.
Barriers.
Initialization.
Signals.
@@ -5515,8 +5518,6 @@ be sent.
pthread_attr_setscope. get and set the contentionscope attribute.pthread_attr_setstack. get and set stack attributes.pthread_attr_setstackaddr. get and set the stackaddr attribute.pthread_cleanup_pop. establish cancellation handlers.pthread_cleanup_push. establish cancellation handlers.pthread_condattr_getclock. set the clock selection condition variable attribute.pthread_condattr_getpshared. get the process-shared condition variable attribute.pthread_condattr_setclock. set the clock selection condition variable attribute.pthread_rwlockattr_getpshared. get and set the process-shared attribute of the read-write lock attributes object.pthread_rwlockattr_init. destroy and initialize the read-write lock attributes object.pthread_rwlockattr_setpshared. get and set the process-shared attribute of the read-write lock attributes object.pthread_setcanceltype. set cancelability state.pthread_setconcurrency. get and set the level of concurrency.pthread_spin_destroy. destroy or initialize a spin lock object.pthread_spin_init. destroy or initialize a spin lock object.pthread_spin_lock. lock a spin lock object.pthread_spin_trylock. lock a spin lock object.pthread_spin_unlock. unlock a spin lock object.pthread_testcancel. set cancelability state.Description: -
The pthread_cancel() function will request that thread
-be canceled. The target thread's cancelability state determines
-when the cancellation takes effect. When the
-cancellation is acted on, thread will be terminated.
The pthread_cancel() function will request that thread be canceled.
+The target thread's cancelability state, enabled, or disabled, determines when the cancellation takes effect: When the cancellation is acted on, thread will be terminated.
+When cancelability is disabled, all cancellations are held pending in the target thread until the thread re-enables cancelability.
When cancelability is disabled, all cancels are held pending -in the target thread until the thread changes the cancelability. -When cancelability is deferred, all cancels are held pending in -the target thread until the thread changes the cancelability or -calls pthread_testcancel().
+The target thread's cancelability state determines how the cancellation is acted on: +Either asychronrously or deferred. +Asynchronous cancellations we be acted upon immediately (when enabled), interrupting the thread with its processing in an abritray state.
-Cancelability is asynchronous; all cancels are acted upon -immediately (when enable), interrupting the thread with its processing.
+When cancelability is deferred, all cancels are held pending in the target thread until the thread changes the cancelability type or a cancellation point function such as pthread_cancel().
Input Parameters: @@ -6018,16 +6013,10 @@ No thread could be found corresponding to that specified by the given thread ID. Assumptions/Limitations:
-POSIX Compatibility: Comparable to the POSIX -interface of the same name. Except:
+POSIX Compatibility: Comparable to the POSIX interface of the same name. Except:Description: -
The pthread_setcancelstate() function atomically
+
+The pthread_setcancelstate() function atomically
sets both the calling thread's cancelability state to the indicated
state and returns the previous cancelability state at the location
referenced by oldstate.
-Legal values for state are PTHREAD_CANCEL_ENABLE and PTHREAD_CANCEL_DISABLE.<.li>
-
-
Any pending thread cancellation may occur at the time that the -cancellation state is set to PTHREAD_CANCEL_ENABLE.
- +Legal values for state are PTHREAD_CANCEL_ENABLE and PTHREAD_CANCEL_DISABLE. + ++Any pending thread cancellation may occur at the time that the +cancellation state is set to PTHREAD_CANCEL_ENABLE. +
+Input Parameters: +
state
-New cancellation state. One of PTHREAD_CANCEL_ENABLE or PTHREAD_CANCEL_DISABLE.<.li>
+New cancellation state. One of PTHREAD_CANCEL_ENABLE or PTHREAD_CANCEL_DISABLE.oldstate.
Location to return the previous cancellation state.
Returned Value:
@@ -6072,38 +6067,148 @@ No thread could be found corresponding to that specified by the given thread ID. POSIX Compatibility: Comparable to the POSIX interface of the same name. -
Function Prototype:
#include <pthread.h>
- int pthread_setcancelstate(void);
+ int pthread_setcanceltype(int type, FAR int *oldtype);
Description: -
NOT SUPPORTED
+The pthread_setcanceltype() function atomically both sets the calling thread's cancelability type to the indicated type and returns the previous cancelability type at the location referenced by oldtype.
+Legal values for type are PTHREAD_CANCEL_DEFERRED and PTHREAD_CANCEL_ASYNCHRONOUS.
+
+The cancelability state and type of any newly created threads are PTHREAD_CANCEL_ENABLE and PTHREAD_CANCEL_DEFERRED respectively.
+
+Input Parameters: +
++
type
+New cancellation state. One of PTHREAD_CANCEL_DEFERRED or PTHREAD_CANCEL_ASYNCHRONOUS.oldtype.
+Location to return the previous cancellation type.
++Returned Value: +
+If successful, the pthread_setcancelstate() function will return
+zero (OK). Otherwise, an error number will be
+returned to indicate the error.
+
+POSIX Compatibility: Comparable to the POSIX interface of the same name. +
+ ++Function Prototype: +
++
+ #include <pthread.h> + void pthread_testcancel(void); ++ +
+Description: +
+
+The pthread_testcancel() function creates a cancellation point in the calling thread.
+The pthread_testcancel() function has no effect if cancelability is disabled.
+
+Input Parameters: None +
++Returned Value: None +
++POSIX Compatibility: Comparable to the POSIX interface of the same name. +
+ ++Function Prototype: +
+
+ #include <pthread.h> + void pthread_cleanup_pop(int execute); ++
+Description: +
+
+The pthread_cleanup_pop() function will remove the routine at the top of the calling thread's cancellation cleanup stack and optionally invoke it (if execute is non-zero).
+
+Input Parameters: +
++
execute. Execute the popped cleanup function immediately.+Returned Value: +
+
+If successful, the pthread_setcancelstate() function will return
+zero (OK). Otherwise, an error number will be
+returned to indicate the error:
+
+
++POSIX Compatibility: Comparable to the POSIX interface of the same name. +
+ ++Function Prototype: +
+
+ #include <pthread.h> + void pthread_cleanup_push(CODE void (*routine)(FAR void *), FAR void *arg); ++
+Description: +
+
+The pthread_cleanup_push() function will push the specified cancellation cleanup handler routine onto the calling thread's cancellation cleanup stack.
+
+The cancellation cleanup handler will be popped from the cancellation cleanup stack and invoked with the argument arg when:
+
+
pthread_exit()).pthread_cleanup_pop() with a non-zero execute argument.Input Parameters:
To be provided.routine. The cleanup routine to be pushed on the the cleanup stack.arg. An argument that will accompany the callback.Returned Value:
If successful, the pthread_setcancelstate() function will return
zero (OK). Otherwise, an error number will be
-returned to indicate the error:
+returned to indicate the error.
+
-
To be provided. -POSIX Compatibility: Comparable to the POSIX -interface of the same name. +POSIX Compatibility: Comparable to the POSIX interface of the same name. +
-Function Prototype:
@@ -6136,7 +6241,7 @@ returned to indicate the error: POSIX Compatibility: Comparable to the POSIX interface of the same name. -
Function Prototype:
@@ -6169,7 +6274,7 @@ returned to indicate the error: POSIX Compatibility: Comparable to the POSIX interface of the same name. -
Function Prototype:
@@ -6201,7 +6306,7 @@ returned to indicate the error: POSIX Compatibility: Comparable to the POSIX interface of the same name. -
Function Prototype:
@@ -6291,7 +6396,7 @@ interface of the same name. Comparable to the POSIX interface of the same name. -Function Prototype:
@@ -6383,7 +6488,7 @@ interface of the same name. Comparable to the POSIX interface of the same name. -Function Prototype:
@@ -6438,7 +6543,7 @@ interface of the same name.
Function Prototype:
@@ -6488,7 +6593,7 @@ interface of the same name. destructor function. -
Function Prototype:
@@ -6529,7 +6634,7 @@ interface of the same name. destructor function. -
Function Prototype:
@@ -6561,7 +6666,7 @@ this function does nothing in the present implementation. POSIX Compatibility: Comparable to the POSIX interface of the same name. -
Function Prototype:
@@ -6592,7 +6697,7 @@ returned to indicate the error: POSIX Compatibility: Comparable to the POSIX interface of the same name. -
Function Prototype:
@@ -6623,7 +6728,7 @@ returned to indicate the error: POSIX Compatibility: Comparable to the POSIX interface of the same name. -
Function Prototype:
@@ -6655,7 +6760,7 @@ returned to indicate the error: POSIX Compatibility: Comparable to the POSIX interface of the same name. -
Function Prototype:
@@ -6687,7 +6792,7 @@ returned to indicate the error: POSIX Compatibility: Comparable to the POSIX interface of the same name. -
Function Prototype:
@@ -6722,7 +6827,7 @@ returned to indicate the error:
POSIX Compatibility: Comparable to the POSIX interface of the same name. -
Function Prototype:
@@ -6776,7 +6881,7 @@ returned to indicate the error:
POSIX Compatibility: Comparable to the POSIX interface of the same name. -
Function Prototype:
@@ -6808,7 +6913,7 @@ returned to indicate the error: POSIX Compatibility: Comparable to the POSIX interface of the same name. -
Function Prototype:
@@ -6839,7 +6944,7 @@ returned to indicate the error: POSIX Compatibility: Comparable to the POSIX interface of the same name. -
Function Prototype:
@@ -6905,7 +7010,7 @@ Otherwise, an error number will be returned to indicate the error: POSIX Compatibility: Comparable to the POSIX interface of the same name. -
Function Prototype:
@@ -6945,7 +7050,7 @@ Otherwise, an error number will be returned to indicate the error: POSIX Compatibility: Comparable to the POSIX interface of the same name. -
Function Prototype:
@@ -6991,7 +7096,7 @@ returned to indicate the error: POSIX Compatibility: Comparable to the POSIX interface of the same name. -
Function Prototype:
@@ -7022,7 +7127,7 @@ returned to indicate the error: POSIX Compatibility: Comparable to the POSIX interface of the same name. -
Function Prototype:
@@ -7053,7 +7158,7 @@ returned to indicate the error: POSIX Compatibility: Comparable to the POSIX interface of the same name. -
Function Prototype:
@@ -7084,7 +7189,7 @@ returned to indicate the error: POSIX Compatibility: Comparable to the POSIX interface of the same name. -
Function Prototype:
@@ -7115,7 +7220,7 @@ returned to indicate the error: POSIX Compatibility: Comparable to the POSIX interface of the same name. -
Function Prototype:
@@ -7146,7 +7251,7 @@ returned to indicate the error: POSIX Compatibility: Comparable to the POSIX interface of the same name. -
Function Prototype:
@@ -7177,7 +7282,7 @@ returned to indicate the error: POSIX Compatibility: Comparable to the POSIX interface of the same name. -
Function Prototype:
@@ -7208,7 +7313,7 @@ returned to indicate the error: POSIX Compatibility: Comparable to the POSIX interface of the same name. -
Function Prototype:
@@ -7245,7 +7350,7 @@ interface of the same name. POSIX Compatibility: Comparable to the POSIX interface of the same name. -Function Prototype:
@@ -7278,7 +7383,7 @@ interface of the same name. POSIX Compatibility: Comparable to the POSIX interface of the same name. -Function Prototype:
@@ -7310,7 +7415,7 @@ interface of the same name. POSIX Compatibility: Comparable to the POSIX interface of the same name. -Function Prototype:
@@ -7348,7 +7453,7 @@ interface of the same name. POSIX Compatibility: Comparable to the POSIX interface of the same name. -Function Prototype:
@@ -7380,7 +7485,7 @@ interface of the same name. POSIX Compatibility: Comparable to the POSIX interface of the same name. -Function Prototype:
@@ -7450,7 +7555,7 @@ interface of the same name. POSIX Compatibility: Comparable to the POSIX interface of the same name. -Function Prototype:
@@ -7494,7 +7599,7 @@ interface of the same name. POSIX Compatibility: Comparable to the POSIX interface of the same name. -Function Prototype:
@@ -7554,7 +7659,7 @@ interface of the same name. -Function Prototype:
@@ -7598,7 +7703,7 @@ interface of the same name. POSIX Compatibility: Comparable to the POSIX interface of the same name. -Function Prototype:
@@ -7660,7 +7765,7 @@ interface of the same name. POSIX Compatibility: Comparable to the POSIX interface of the same name. -Function Prototype:
@@ -10077,7 +10182,8 @@ notify a task when a message is available on a queue.