diff --git a/Documentation/NuttX.html b/Documentation/NuttX.html
index a0f552e8d7..3a48481f2e 100644
--- a/Documentation/NuttX.html
+++ b/Documentation/NuttX.html
@@ -8,7 +8,7 @@
diff --git a/Documentation/NuttxPortingGuide.html b/Documentation/NuttxPortingGuide.html
index d59315db9c..44059c231d 100644
--- a/Documentation/NuttxPortingGuide.html
+++ b/Documentation/NuttxPortingGuide.html
@@ -1408,6 +1408,9 @@ The system can be re-made subsequently by just typing make
.
CONFIG_DEV_CONSOLE
: Set if architecture-specific logic
provides /dev/console. Enables stdout, stderr, stdin.
+
+ CONFIG_MUTEX_TYPES
: Set to enabled support for recursive and
+ errorcheck mutexes. Enables pthread_mutexattr_settype()
.
diff --git a/Documentation/NuttxUserGuide.html b/Documentation/NuttxUserGuide.html
index a5ef33f1b3..554915b772 100644
--- a/Documentation/NuttxUserGuide.html
+++ b/Documentation/NuttxUserGuide.html
@@ -21,7 +21,7 @@ User's Manual
Gregory Nutt
-Last Update: Februrary 2, 2008
+Last Update: May 31, 2008
@@ -3434,32 +3434,34 @@ be sent.
2.9.27 pthread_mutexattr_destroy
2.9.28 pthread_mutexattr_getpshared
2.9.29 pthread_mutexattr_setpshared
- 2.9.30 pthread_mutex_init
- 2.9.31 pthread_mutex_destroy
- 2.9.32 pthread_mutex_lock
- 2.9.33 pthread_mutex_trylock
- 2.9.34 pthread_mutex_unlock
- 2.9.35 pthread_condattr_init
- 2.9.36 pthread_condattr_destroy
- 2.9.37 pthread_cond_init
- 2.9.38 pthread_cond_destroy
- 2.9.39 pthread_cond_broadcast
- 2.9.40 pthread_cond_signal
- 2.9.41 pthread_cond_wait
- 2.9.42 pthread_cond_timedwait
- 2.9.43 pthread_barrierattr_init
- 2.9.44 pthread_barrierattr_destroy
- 2.9.45 pthread_barrierattr_setpshared
- 2.9.46 pthread_barrierattr_getpshared
- 2.9.47 pthread_barrier_init
- 2.9.48 pthread_barrier_destroy
- 2.9.49 pthread_barrier_wait
- 2.9.50 pthread_once
- 2.9.51 pthread_kill
- 2.9.52 pthread_sigmask
+ 2.9.30 pthread_mutexattr_gettype
+ 2.9.31 pthread_mutexattr_settype
+ 2.9.32 pthread_mutex_init
+ 2.9.33 pthread_mutex_destroy
+ 2.9.34 pthread_mutex_lock
+ 2.9.35 pthread_mutex_trylock
+ 2.9.36 pthread_mutex_unlock
+ 2.9.37 pthread_condattr_init
+ 2.9.38 pthread_condattr_destroy
+ 2.9.39 pthread_cond_init
+ 2.9.40 pthread_cond_destroy
+ 2.9.41 pthread_cond_broadcast
+ 2.9.42 pthread_cond_signal
+ 2.9.43 pthread_cond_wait
+ 2.9.44 pthread_cond_timedwait
+ 2.9.45 pthread_barrierattr_init
+ 2.9.46 pthread_barrierattr_destroy
+ 2.9.47 pthread_barrierattr_setpshared
+ 2.9.48 pthread_barrierattr_getpshared
+ 2.9.49 pthread_barrier_init
+ 2.9.50 pthread_barrier_destroy
+ 2.9.51 pthread_barrier_wait
+ 2.9.52 pthread_once
+ 2.9.53 pthread_kill
+ 2.9.54 pthread_sigmask
- No support for the ollowing pthread interfaces is provided by NuttX:
+ No support for the following pthread interfaces is provided by NuttX:
pthread_atfork
. register fork handlers.
@@ -3479,10 +3481,10 @@ be sent.
pthread_barrier_wait
. synchronize at a barrier.
pthread_cleanup_pop
. establish cancellation handlers.
pthread_cleanup_push
. establish cancellation handlers.
- pthread_condattr_getclock
. get and set the clock selection condition variable attribute.
- pthread_condattr_getpshared
. get and set the process-shared condition variable attributes.
- pthread_condattr_setclock
. get and set the clock selection condition variable attribute.
- pthread_condattr_setpshared
. get and set the process-shared condition variable attributes.
+ 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_condattr_setpshared
. set the process-shared condition variable attribute.
pthread_getconcurrency
. get and set the level of concurrency.
pthread_getcpuclockid
. access a thread CPU-time clock.
pthread_mutex_getprioceiling
. get and set the priority ceiling of a mutex.
@@ -3490,10 +3492,8 @@ be sent.
pthread_mutex_timedlock
. lock a mutex.
pthread_mutexattr_getprioceiling
. get and set the prioceiling attribute of the mutex attributes object.
pthread_mutexattr_getprotocol
. get and set the protocol attribute of the mutex attributes object.
- pthread_mutexattr_gettype
. get and set the mutex type attribute.
pthread_mutexattr_setprioceiling
. get and set the prioceiling attribute of the mutex attributes object.
pthread_mutexattr_setprotocol
. get and set the protocol attribute of the mutex attributes object.
- pthread_mutexattr_settype
. get and set the mutex type attribute.
pthread_rwlock_destroy
. destroy and initialize a read-write lock object.
pthread_rwlock_init
. destroy and initialize a read-write lock object.
pthread_rwlock_rdlock
. lock a read-write lock object for reading.
@@ -4627,7 +4627,93 @@ returned to indicate the error:
POSIX Compatibility: Comparable to the POSIX
interface of the same name.
-
+
+
+Function Prototype:
+
+
+ #include <pthread.h>
+#ifdef CONFIG_MUTEX_TYPES
+ int pthread_mutexattr_gettype(const pthread_mutexattr_t *attr, int *type);
+#endif
+
+
+Description: Return the mutex type from the mutex attributes.
+
+Input Parameters:
+
+
+ attr
. The mutex attributes to query
+ type
. Location to return the mutex type. See
+ pthread_mutexattr_setttyp()
+ for a description of possible mutex types that may be returned.
+
+
+Returned Values:
+
+If successful, the pthread_mutexattr_settype() function will return
+zero (OK). Otherwise, an error number will be
+returned to indicate the error:
+
+
+ EINVAL
. Parameters attr
and/or attr
are invalid.
+
+Assumptions/Limitations:
+
+POSIX Compatibility: Comparable to the POSIX interface of the same name.
+
+
+
+Function Prototype:
+
+
+ #include <pthread.h>
+#ifdef CONFIG_MUTEX_TYPES
+ int pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type);
+#endif
+
+
+Description: Set the mutex type in the mutex attributes.
+
+Input Parameters:
+
+
+ attr
. The mutex attributes in which to set the mutex type.
+ type
. The mutex type value to set. The following values are supported:
+
+ PTHREAD_MUTEX_NORMAL
. This type of mutex does not detect deadlock. A thread
+ attempting to relock this mutex without first unlocking it will deadlock.
+ Attempting to unlock a mutex locked by a different thread results in undefined
+ behavior. Attempting to unlock an unlocked mutex results in undefined behavior.
+ PTHREAD_MUTEX_ERRORCHECK
. This type of mutex provides error checking.
+ A thread attempting to relock this mutex without first unlocking it will return with an error.
+ A thread attempting to unlock a mutex which another thread has locked will return with an error.
+ A thread attempting to unlock an unlocked mutex will return with an error.
+ PTHREAD_MUTEX_RECURSIVE
. A thread attempting to relock this mutex without first
+ unlocking it will succeed in locking the mutex. The relocking deadlock which can occur with mutexes
+ of type PTHREAD_MUTEX_NORMAL cannot occur with this type of mutex. Multiple locks of this mutex
+ require the same number of unlocks to release the mutex before another thread can acquire the mutex.
+ A thread attempting to unlock a mutex which another thread has locked will return with an error.
+ A thread attempting to unlock an unlocked mutex will return with an error.
+ PTHREAD_MUTEX_DEFAULT
. The default mutex type (PTHREAD_MUTEX_NORMAL).
+
+ In NuttX, PTHREAD_MUTEX_NORMAL is not implemented. PTHREAD_MUTEX_ERRORCHECK is the normal behavior.
+
+
+Returned Values:
+
+If successful, the pthread_mutexattr_settype() function will return
+zero (OK). Otherwise, an error number will be
+returned to indicate the error:
+
+
+ EINVAL
. Parameters attr
and/or attr
are invalid.
+
+Assumptions/Limitations:
+
+POSIX Compatibility: Comparable to the POSIX interface of the same name.
+
+
Function Prototype:
@@ -4659,7 +4745,7 @@ returned to indicate the error:
POSIX Compatibility: Comparable to the POSIX
interface of the same name.
-
+
Function Prototype:
@@ -4690,7 +4776,7 @@ returned to indicate the error:
POSIX Compatibility: Comparable to the POSIX
interface of the same name.
-
+
Function Prototype:
@@ -4721,7 +4807,7 @@ returned to indicate the error:
POSIX Compatibility: Comparable to the POSIX
interface of the same name.
-
+
Function Prototype:
@@ -4752,7 +4838,7 @@ returned to indicate the error:
POSIX Compatibility: Comparable to the POSIX
interface of the same name.
-
+
Function Prototype:
@@ -4783,7 +4869,7 @@ returned to indicate the error:
POSIX Compatibility: Comparable to the POSIX
interface of the same name.
-
+
Function Prototype:
@@ -4814,7 +4900,7 @@ returned to indicate the error:
POSIX Compatibility: Comparable to the POSIX
interface of the same name.
-
+
Function Prototype:
@@ -4845,7 +4931,7 @@ returned to indicate the error:
POSIX Compatibility: Comparable to the POSIX
interface of the same name.
-
+
Function Prototype:
@@ -4876,7 +4962,7 @@ returned to indicate the error:
POSIX Compatibility: Comparable to the POSIX
interface of the same name.
-
+
Function Prototype:
@@ -4907,7 +4993,7 @@ returned to indicate the error:
POSIX Compatibility: Comparable to the POSIX
interface of the same name.
-
+
Function Prototype:
@@ -4938,7 +5024,7 @@ returned to indicate the error:
POSIX Compatibility: Comparable to the POSIX
interface of the same name.
-
+
Function Prototype:
@@ -4969,7 +5055,7 @@ returned to indicate the error:
POSIX Compatibility: Comparable to the POSIX
interface of the same name.
-
+
Function Prototype:
@@ -5000,7 +5086,7 @@ returned to indicate the error:
POSIX Compatibility: Comparable to the POSIX
interface of the same name.
-
+
Function Prototype:
@@ -5037,7 +5123,7 @@ interface of the same name.
POSIX Compatibility: Comparable to the POSIX interface of the same name.
-
+
Function Prototype:
@@ -5070,7 +5156,7 @@ interface of the same name.
POSIX Compatibility: Comparable to the POSIX interface of the same name.
-
+
Function Prototype:
@@ -5102,7 +5188,7 @@ interface of the same name.
POSIX Compatibility: Comparable to the POSIX interface of the same name.
-
+
Function Prototype:
@@ -5140,7 +5226,7 @@ interface of the same name.
POSIX Compatibility: Comparable to the POSIX interface of the same name.
-
+
Function Prototype:
@@ -5172,7 +5258,7 @@ interface of the same name.
POSIX Compatibility: Comparable to the POSIX interface of the same name.
-
+
Function Prototype:
@@ -5242,7 +5328,7 @@ interface of the same name.
POSIX Compatibility: Comparable to the POSIX interface of the same name.
-
+
Function Prototype:
@@ -5286,7 +5372,7 @@ interface of the same name.
POSIX Compatibility: Comparable to the POSIX interface of the same name.
-
+
Function Prototype:
@@ -5346,7 +5432,7 @@ interface of the same name.
-
+
Function Prototype:
@@ -5390,7 +5476,7 @@ interface of the same name.
POSIX Compatibility: Comparable to the POSIX interface of the same name.
-
+
Function Prototype:
@@ -5452,7 +5538,7 @@ interface of the same name.
POSIX Compatibility: Comparable to the POSIX interface of the same name.
-
+
Function Prototype:
@@ -6722,11 +6808,13 @@ notify a task when a message is available on a queue.
pthread_kill
pthread_mutexattr_destroy
pthread_mutexattr_getpshared
+ pthread_mutexattr_gettype
pthread_mutexattr_init
pthread_mutexattr_setpshared
- pthread_mutex_destroy
+ pthread_mutexattr_settype
+ pthread_mutex_destroy
pthread_mutex_init
pthread_mutex_lock
pthread_mutex_trylock
|