librelist archives

« back to archive

Thread-safety status of libgit2?

Thread-safety status of libgit2?

Nelson Elhage
2011-11-11 @ 00:32

I was hoping someone could clarify the current status of thread-safety
in libgit2. From skimming the code and some tests, it looks like
THREADSAFE is currently still in-progress, and it is not safe to use a
git_repository or other libgit2 object from multiple threads without
external locking -- is that understanding correct?

Is it at least safe to use multiple libgit2 repositories from
different threads, as long as no single object is used concurrently
from multiple threads? Again, based on skimming the code this looks to
be the case, but it'd be nice to know that's explicitly supported.

- Nelson