diff options
| author | Carlos MartÃn Nieto <[email protected]> | 2016-11-01 00:16:27 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2016-11-01 00:16:27 +0100 |
| commit | 9af9dd3ad71055e60ff7af6ffd5da42960915996 (patch) | |
| tree | e329c89e802e83dcbfa615e366350afe4412ab01 /git.go | |
| parent | 098cd42070db3393651752ddbbf0726db5778c7c (diff) | |
| parent | a37f7f30ff94e32b20866cf2fa28496c60826278 (diff) | |
Merge pull request #354 from libgit2/cmn/panic-threading
Add Feature query support & panic if libgit2 is not thread-aware
Diffstat (limited to 'git.go')
| -rw-r--r-- | git.go | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -124,6 +124,15 @@ func init() { C.git_libgit2_init() + // Due to the multithreaded nature of Go and its interaction with + // calling C functions, we cannot work with a library that was not built + // with multi-threading support. The most likely outcome is a segfault + // or panic at an incomprehensible time, so let's make it easy by + // panicking right here. + if Features()&FeatureThreads == 0 { + panic("libgit2 was not built with threading support") + } + // This is not something we should be doing, as we may be // stomping all over someone else's setup. The user should do // this themselves or use some binding/wrapper which does it |
