summaryrefslogtreecommitdiff
path: root/patch.go
diff options
context:
space:
mode:
authorCarlos Martín Nieto <[email protected]>2014-12-06 02:44:57 +0100
committerCarlos Martín Nieto <[email protected]>2014-12-06 02:45:26 +0100
commit8c631b0c25c8de616afa2fd89378299c9d9a1439 (patch)
tree4f37d5612f17bc13a0a3d1b71019711430eab0c4 /patch.go
parent0ec2f4665913a37df6f4d5704ea3a69bae2eb8b3 (diff)
Add missing thread locking
Diffstat (limited to 'patch.go')
-rw-r--r--patch.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/patch.go b/patch.go
index 0665501..0fe1c04 100644
--- a/patch.go
+++ b/patch.go
@@ -40,6 +40,10 @@ func (patch *Patch) String() (string, error) {
return "", ErrInvalid
}
var buf C.git_buf
+
+ runtime.LockOSThread()
+ defer runtime.UnlockOSThread()
+
ecode := C.git_patch_to_buf(&buf, patch.ptr)
if ecode < 0 {
return "", MakeGitError(ecode)