[Ecls-list] Multi-threaded support for cygwin

Arthur Smyles atsmyles at earthlink.net
Thu Mar 2 13:14:01 UTC 2006


I fixed a problem with multi-threaded support in Cygwin. Some of the constants in pthreads.h are different than in the linux builds. Also added proper configuration for cygwin in the configuration script.

Arthur

Index: src/h/ecl.h
===================================================================
RCS file: /cvsroot/ecls/ecls/src/h/ecl.h,v
retrieving revision 1.23
diff -u -r1.23 ecl.h
--- src/h/ecl.h	28 Feb 2006 14:05:48 -0000	1.23
+++ src/h/ecl.h	1 Mar 2006 19:03:33 -0000
@@ -47,7 +47,14 @@
 #   define CreateThread GC_CreateThread
 #  endif
 # else
-#  include <pthread.h>
+#  include <pthread.h> 
+#  if defined(cygwin) /*Need to rename some constants because pthread.h different than on linux*/
+#   define PTHREAD_MUTEX_FAST_NP PTHREAD_MUTEX_NORMAL
+#   define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE
+#   define PTHREAD_MUTEX_ERRORCHECK_NP PTHREAD_MUTEX_ERRORCHECK
+#   define PTHREAD_MUTEX_TIMED_NP PTHREAD_MUTEX_NORMAL
+#   define PTHREAD_MUTEX_ADAPTIVE_NP PTHREAD_MUTEX_NORMAL
+#  endif /*cygwin*/
 # endif
 # define start_critical_section()
 # define end_critical_section()

Index: src/configure
===================================================================
RCS file: /cvsroot/ecls/ecls/src/configure,v
retrieving revision 1.148
diff -u -r1.148 configure
--- src/configure	28 Feb 2006 17:31:42 -0000	1.148
+++ src/configure	1 Mar 2006 20:17:28 -0000
@@ -3555,7 +3555,8 @@
 	cygwin*)
 		thehost='cygwin'
 		shared='yes'
-		THREAD_OBJ=''
+		THREAD_CFLAGS='-D_THREAD_SAFE'
+		THREAD_LIBS='-lpthread'
 		SHARED_LDFLAGS="-shared ${LDFLAGS}"
 		BUNDLE_LDFLAGS="-shared ${LDFLAGS}"






More information about the ecl-devel mailing list