From 8cef828d8d115c1f98678c13721fee59ca4540b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Sat, 18 Aug 2012 22:11:49 +0200 Subject: Make the memory-window conrol structures global Up to now, the idea was that the user would do all the operations for one repository in the same thread. Thus we could have the memory-mapped window information thread-local and avoid any locking. This is not practical in a few environments, such as Apple's GCD which allocates threads arbitrarily or the .NET CLR, where the OS-level thread can change at any moment. Make the control structure global and protect it with a mutex so we don't depend on the thread currently executing the code. --- src/global.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/global.h') diff --git a/src/global.h b/src/global.h index 6e7373fa3..0ad41ee63 100644 --- a/src/global.h +++ b/src/global.h @@ -12,12 +12,12 @@ typedef struct { git_error *last_error; git_error error_t; - - git_mwindow_ctl mem_ctl; } git_global_st; git_global_st *git__global_state(void); +extern git_mutex git__mwindow_mutex; + #define GIT_GLOBAL (git__global_state()) #endif -- cgit v1.2.1