libgit2/libgit2 — Issue #478: `static git_mwindow_ctl ctl` is not threadsafe
Author: nelhage
Created: 2011-11-11 04:51:54+00:00
State: open

`git_repository` and friends is not threadsafe. That's understandable. But the global `git_mwindow` structure used to cache `mmap` regions is shared across all `git_repository` objects, and is not threadsafe at all -- using multiple `git_repository`s heavily from different threads will eventually lead to a crash due to corruption of the `ctl` object. It should either be declared threadsafe or protected with a mutex (at least under THREADSAFE=on).