This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Pthread Mutex Attributes Extension


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

This patch refers to the Single Unix Specification 2 for mutex
attribute type extension.

- --- newlib/libc/include/pthread.h	2006-09-13 19:09:27.000000000 -0300
+++ ../../tools/arm-elf/include/pthread.h	2008-09-16 09:51:32.214924280 -0300
@@ -57,6 +57,17 @@
 int	_EXFUN(pthread_mutexattr_setpshared,
 		(pthread_mutexattr_t *__attr, int __pshared));

+#if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES)
+
+/* Single UNIX Specification 2 Mutex Attributes types */
+
+int _EXFUN(pthread_mutexattr_gettype,
+		(_CONST pthread_mutexattr_t *__attr, int *__kind));
+int _EXFUN(pthread_mutexattr_settype,
+		(pthread_mutexattr_t *__attr, int __kind));
+
+#endif
+
 /* Initializing and Destroying a Mutex, P1003.1c/Draft 10, p. 87 */

 int	_EXFUN(pthread_mutex_init,

- --- newlib/libc/include/sys/types.h	2007-09-18 17:05:17.000000000 -0300
+++ ../../tools/arm-elf/include/sys/types.h	2008-09-16 11:08:37.574924465 -0300
@@ -323,6 +323,17 @@
 #define PTHREAD_PRIO_PROTECT 2
 #endif

+#if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES)
+
+/* Values for mutex type */
+
+#define PTHREAD_MUTEX_NORMAL     0
+#define PTHREAD_MUTEX_RECURSIVE  1
+#define PTHREAD_MUTEX_ERRORCHECK 2
+#define PTHREAD_MUTEX_DEFAULT    3
+
+#endif
+
 typedef __uint32_t pthread_mutex_t;      /* identify a mutex */

 typedef struct {
@@ -334,6 +345,9 @@
   int   prio_ceiling;
   int   protocol;
 #endif
+#if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES)
+  int type;
+#endif
   int   recursive;
 } pthread_mutexattr_t;


- --
Raphael Derosso Pereira
Engenheiro de Computação
icq: 4517421
msn: rderossopereira@hotmail.com
Skype: rderossopereira

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: http://getfiregpg.org

iD8DBQFI0+B7YcVjciDA62QRAvVhAKDsdbg+tnnnS659ZIDUigJToJqyigCfaKWW
LxeiPEpk25n9cBvNROSg6qo=
=QtAQ
-----END PGP SIGNATURE-----


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]