Move os thread lock to outer scope in defaultapplyoptions

This commit is contained in:
Michael Boulton 2020-08-18 08:16:29 +01:00
parent 633f7639db
commit 05a41f164c
No known key found for this signature in database
GPG Key ID: 8A62CA0BE2E0197E
1 changed files with 3 additions and 2 deletions

View File

@ -916,10 +916,11 @@ func deltaApplyCallback(_delta *C.git_diff_delta, _payload unsafe.Pointer) C.int
func DefaultApplyOptions() (*ApplyOptions, error) {
opts := C.git_apply_options{}
runtime.LockOSThread()
defer runtime.UnlockOSThread()
ecode := C.git_apply_options_init(&opts, C.GIT_APPLY_OPTIONS_VERSION)
if int(ecode) != 0 {
runtime.LockOSThread()
defer runtime.UnlockOSThread()
return nil, MakeGitError(ecode)
}