Hi Konstantin,
> PS: Alessandro, can we discuss themes like this in this list?
>
why not ? we'll immediately start
just few quick comments about your proposed patch:
1. using semaphores was strictly required by older versions
of GEOS that weren't safely reentrant thus causing endless
troubles to multithreded applications.
but starting from GEOS v.3.5.0 (released on August 2015)
GEOS is now fully reentrant, so these portions of code
are no longer useful and are still preserved just not to
break legacy support for obsolete versions of GEOS
(please look at the conditional GEOS_REENTRANT set by
./configure)
2. the basic idea was to use libpthread on Linux and MinGW
switching to the Windows native CriticalSection only
when using the MSVC compiler.
3. I've never used the clang compiler on Windows, but I
easily imagine that it has problems in supporting
libpthreads; do you confirm ?
short conclusion: always using the Windows native
semaphores instead of the ones supported by pthreads
seems to be a more portable solution.
I've absolutely no objections in this case (mainly
because we are talking about "dead code" no longer
required), but I'm afraid for other libraries like
librasterlite2 that make a wider use of multithreading.
switching from libpthread to Windows native support
could be a little bit harder.
just for my personal curiosity, please explain in
more depth where are the troubles for the clang
compiler.
bye Sandro