Skip to content

Commit

Permalink
Add missing thread-locking
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosmn committed Dec 11, 2014
1 parent 1198f82 commit cb6201b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit cb6201b

Please sign in to comment.