This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
[PATCH] Define _POSIX_SPIN_LOCKS on Cygwin
- From: "Yaakov (Cygwin/X)" <yselkowitz at users dot sourceforge dot net>
- To: newlib <newlib at sources dot redhat dot com>
- Date: Mon, 02 May 2011 10:39:09 -0500
- Subject: [PATCH] Define _POSIX_SPIN_LOCKS on Cygwin
Corinna,
Now that you have implemented pthread_spin_*(), can't _POSIX_SPIN_LOCKS
be defined now? Patch for newlib attached.
Yaakov
Cygwin/X
2011-05-02 Yaakov Selkowitz <yselkowitz@...>
* libc/include/sys/features.h [__CYGWIN__] (_POSIX_SPIN_LOCKS): Define.
* libc/include/sys/types.h: Cygwin provides its own pthread_spinlock_t
typedef.
Index: libc/include/sys/features.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/sys/features.h,v
retrieving revision 1.23
diff -u -r1.23 features.h
--- libc/include/sys/features.h 27 Jan 2011 11:55:01 -0000 1.23
+++ libc/include/sys/features.h 2 May 2011 15:33:47 -0000
@@ -125,7 +125,7 @@
#define _POSIX_SHARED_MEMORY_OBJECTS 200112L
#define _POSIX_SHELL 1
/* #define _POSIX_SPAWN -1 */
-/* #define _POSIX_SPIN_LOCKS -1 */
+#define _POSIX_SPIN_LOCKS 200112L
/* #define _POSIX_SPORADIC_SERVER -1 */
#define _POSIX_SYNCHRONIZED_IO 200112L
/* #define _POSIX_THREAD_ATTR_STACKADDR -1 */
Index: libc/include/sys/types.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/sys/types.h,v
retrieving revision 1.35
diff -u -r1.35 types.h
--- libc/include/sys/types.h 15 Jan 2011 09:26:16 -0000 1.35
+++ libc/include/sys/types.h 2 May 2011 15:33:47 -0000
@@ -463,13 +463,13 @@
/* POSIX Spin Lock Types */
+#if !defined (__CYGWIN__)
#if defined(_POSIX_SPIN_LOCKS)
typedef __uint32_t pthread_spinlock_t; /* POSIX Spin Lock Object */
#endif /* defined(_POSIX_SPIN_LOCKS) */
/* POSIX Reader/Writer Lock Types */
-#if !defined (__CYGWIN__)
#if defined(_POSIX_READER_WRITER_LOCKS)
typedef __uint32_t pthread_rwlock_t; /* POSIX RWLock Object */
typedef struct {