Re: [PATCH] MSVC: port pthread code to native Windows threads
- From
Andrzej K. Haczewski <ahaczewski@gmail.com>
- Date
- Nov 4, 2009, 14:50 UTC
- Message-ID
- <16cee31f0911040650s3eba1067mb66a48bb50c97c28@mail.gmail.com>
- In-Reply-To
- <4AF190F1.3020607@viscovery.net>
2009/11/4 Johannes Sixt <j.sixt@viscovery.net>:
Show 8 quoted lines
> > You are right. But #ifdef THREADED_DELTA_SEARCH is about a "generic" > property of the code and is already used elsewhere in the file, whereas > #ifdef WIN32 would be new and is is about platform differences. > > Anyway, we would have to see what Junio says about the new function calls, > because he's usually quite anal when it comes to added code vs. static > initialization. ;)
I could do it with wrappers for pthread_mutex_lock and _unlock and lazy init there plus lazy init cond var in cond_wait and _signal, that way it could be done without any additional code in the first #ifdef. But I don't see any simple solution for working around deinitialization, that's why I'd leave non-static initialization. Let me put some touchups and resubmit for another round.
-- Andrzej