Add proper threading support to libgit2

We now depend on libpthread on all Unix platforms (should be installed
by default) and use a simple wrapper for Windows threads under Win32.

Signed-off-by: Vicent Marti <tanoku@gmail.com>
This commit is contained in:
Vicent Marti
2011-03-15 21:14:07 +02:00
parent b5abb881a6
commit bbcc7ffc69
8 changed files with 244 additions and 142 deletions
+1 -9
View File
@@ -32,7 +32,6 @@
*/
#define GIT_HAS_TLS 1
#define GIT_HAS_PTHREAD 1
#if defined(__APPLE__) && defined(__MACH__)
# undef GIT_TLS
@@ -47,7 +46,6 @@
#elif defined(__INTEL_COMPILER)
# if defined(_WIN32) || defined(_WIN32_CE)
# define GIT_TLS __declspec(thread)
# undef GIT_HAS_PTHREAD
# else
# define GIT_TLS __thread
# endif
@@ -56,11 +54,9 @@
defined(_WIN32_CE) || \
defined(__BORLANDC__)
# define GIT_TLS __declspec(thread)
# undef GIT_HAS_PTHREAD
#else
# undef GIT_HAS_TLS
# undef GIT_HAS_PTHREAD
# define GIT_TLS /* nothing: tls vars are thread-global */
#endif
@@ -71,10 +67,6 @@
# define GIT_TLS
#endif
#ifdef GIT_HAS_PTHREAD
# define GIT_THREADS 1
#else
# undef GIT_THREADS
#endif
#define GIT_THREADS 1
#endif /* INCLUDE_git_thread_utils_h__ */