Move os thread lock to outer scope in defaultapplyoptions
This commit is contained in:
parent
633f7639db
commit
05a41f164c
5
diff.go
5
diff.go
|
@ -916,10 +916,11 @@ func deltaApplyCallback(_delta *C.git_diff_delta, _payload unsafe.Pointer) C.int
|
||||||
func DefaultApplyOptions() (*ApplyOptions, error) {
|
func DefaultApplyOptions() (*ApplyOptions, error) {
|
||||||
opts := C.git_apply_options{}
|
opts := C.git_apply_options{}
|
||||||
|
|
||||||
|
runtime.LockOSThread()
|
||||||
|
defer runtime.UnlockOSThread()
|
||||||
|
|
||||||
ecode := C.git_apply_options_init(&opts, C.GIT_APPLY_OPTIONS_VERSION)
|
ecode := C.git_apply_options_init(&opts, C.GIT_APPLY_OPTIONS_VERSION)
|
||||||
if int(ecode) != 0 {
|
if int(ecode) != 0 {
|
||||||
runtime.LockOSThread()
|
|
||||||
defer runtime.UnlockOSThread()
|
|
||||||
|
|
||||||
return nil, MakeGitError(ecode)
|
return nil, MakeGitError(ecode)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue