summaryrefslogtreecommitdiff
path: root/patch.go
diff options
context:
space:
mode:
authorCarlos Martín Nieto <[email protected]>2014-12-11 02:46:42 +0100
committerCarlos Martín Nieto <[email protected]>2014-12-11 02:46:42 +0100
commitcb6201b6336366651dcf146c626a4a1a44d20d79 (patch)
tree84b6d662a63f141e4fd8ffc50e0741f7e8d4b8ef /patch.go
parent1198f829b1f1e2dc907445769a2a1ea30f5df571 (diff)
Add missing thread-locking
Diffstat (limited to 'patch.go')
-rw-r--r--patch.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/patch.go b/patch.go
index ea01b87..45e14ac 100644
--- a/patch.go
+++ b/patch.go
@@ -76,6 +76,9 @@ func (v *Repository) PatchFromBuffers(oldPath, newPath string, oldBuf, newBuf []
copts, _ := diffOptionsToC(opts)
defer freeDiffOptions(copts)
+ runtime.LockOSThread()
+ defer runtime.UnlockOSThread()
+
ecode := C.git_patch_from_buffers(&patchPtr, oldPtr, C.size_t(len(oldBuf)), cOldPath, newPtr, C.size_t(len(newBuf)), cNewPath, copts)
if ecode < 0 {
return nil, MakeGitError(ecode)