summaryrefslogtreecommitdiff
path: root/src/mwindow.h
diff options
context:
space:
mode:
authorCarlos Martín Nieto <carlos@cmartin.tk>2012-08-18 22:11:49 +0200
committerCarlos Martín Nieto <cmn@elego.de>2012-08-20 12:02:52 +0200
commit8cef828d8d115c1f98678c13721fee59ca4540b7 (patch)
tree811ff0ad2b4b324cf4b11fd0f2b0ede1fdc04071 /src/mwindow.h
parent1a10fded40875f986164b80c6efd414cd1507cb8 (diff)
downloadlibgit2-8cef828d8d115c1f98678c13721fee59ca4540b7.tar.gz
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.
Diffstat (limited to 'src/mwindow.h')
-rw-r--r--src/mwindow.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/src/mwindow.h b/src/mwindow.h
index d4fd19569..c5aeaf77b 100644
--- a/src/mwindow.h
+++ b/src/mwindow.h
@@ -38,7 +38,6 @@ typedef struct git_mwindow_ctl {
int git_mwindow_contains(git_mwindow *win, git_off_t offset);
void git_mwindow_free_all(git_mwindow_file *mwf);
unsigned char *git_mwindow_open(git_mwindow_file *mwf, git_mwindow **cursor, git_off_t offset, size_t extra, unsigned int *left);
-void git_mwindow_scan_lru(git_mwindow_file *mwf, git_mwindow **lru_w, git_mwindow **lru_l);
int git_mwindow_file_register(git_mwindow_file *mwf);
int git_mwindow_file_deregister(git_mwindow_file *mwf);
void git_mwindow_close(git_mwindow **w_cursor);