Soeren Gebbert wrote: > >> Example which works for me in my test code: > >> > >> /*Thread local and setjmp() exception support*/ > >> #include <setjmp.h> > >> #ifdef WIN32 > >> #define Thread __declspec( thread ) > >> #else > >> #define Thread __thread > >> #endif > > > > The __thread qualifier is a gcc extension. > > Yes, wikipedia says it works for: > Sun Studio C/C++, IBM XL C/C++, GNU C and Intel C/C++ (Linux systems) > > Using the pthreads implementation will be a better solution?
Any thread-local state needs to be conditionalised upon the actual threading mechanism used, with a fall-back to a single instance (i.e. a simple variable). > >> Is this approach ok or to simple or just naive? :) > > > > It's too invasive. The longjmp() should go into an application-defined > > error handler, rather than the GRASS libraries. > > Ok. The error handler looks like that for now: [snip] Yep; that's the general idea. -- Glynn Clements <[email protected]> _______________________________________________ grass-dev mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/grass-dev
