This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


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

error in pthreads implementation?


I'm currently working on getting gcj to work properly with cygwin, and
am working on threading code; I seem to have found a bug in the
implementation of pthreads.h.  This is quite possibly gcc 3.0 specific,
but when the macro pthread_cleanup_push(...) is used, I get the
following error from the compiler:

../../gcc-20010702/boehm-gc/cygwin_threads.c:455: function
`__cleanup_routine' is initialized like a variable

The attached diff seems to solve the problem, although it hasn't been
thoroughly tested.

Jules

--- pthread.h.orig	Sat Jul  7 12:47:48 2001
+++ pthread.h	Sat Jul  7 12:48:04 2001
@@ -99,11 +99,11 @@
 /* Macros for cleanup_push and pop; 
  * The function definitions are
 void pthread_cleanup_push (void (*routine)(void*), void *arg);
 void pthread_cleanup_pop (int execute);
 */
-typedef void __cleanup_routine_type (void *);
+typedef void (*__cleanup_routine_type) (void *);
 
 #define pthread_cleanup_push(fn, arg) { __cleanup_routine_type __cleanup_routine=fn; \
 void *__cleanup_param=arg;
 #define pthread_cleanup_pop(execute) if (execute) __cleanup_routine(__cleanup_param); }
 

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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