summaryrefslogtreecommitdiff
path: root/diff.go
diff options
context:
space:
mode:
authorCarlos Martín Nieto <[email protected]>2014-12-06 02:58:28 +0100
committerCarlos Martín Nieto <[email protected]>2014-12-06 03:03:26 +0100
commit520a0425c736c7d584d21d073b08a8735dd2464f (patch)
treeaf5f03129117c9179dcdf71c11c867116fb24ab5 /diff.go
parent8c631b0c25c8de616afa2fd89378299c9d9a1439 (diff)
Add the newer missing thread-locking instances
Diffstat (limited to 'diff.go')
-rw-r--r--diff.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/diff.go b/diff.go
index d7d8118..00f4bd5 100644
--- a/diff.go
+++ b/diff.go
@@ -179,6 +179,9 @@ func (diff *Diff) FindSimilar(opts *DiffFindOptions) error {
}
}
+ runtime.LockOSThread()
+ defer runtime.UnlockOSThread()
+
ecode := C.git_diff_find_similar(diff.ptr, copts)
if ecode < 0 {
return MakeGitError(ecode)
@@ -404,6 +407,10 @@ type DiffFindOptions struct {
func DefaultDiffFindOptions() (DiffFindOptions, error) {
opts := C.git_diff_find_options{}
+
+ runtime.LockOSThread()
+ defer runtime.UnlockOSThread()
+
ecode := C.git_diff_find_init_options(&opts, C.GIT_DIFF_FIND_OPTIONS_VERSION)
if ecode < 0 {
return DiffFindOptions{}, MakeGitError(ecode)