More diff functionality #629
3
diff.go
3
diff.go
|
@ -912,9 +912,6 @@ 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()
|
||||
|
||||
C._go_git_apply_init_options(&opts)
|
||||
|
||||
|
||||
return applyOptionsFromC(&opts), nil
|
||||
|
|
Loading…
Reference in New Issue
Can these be returned to their old place? The reason why they are needed is that when
runtime.LockOsThread()
/runtime.UnlockOSThread()
combo is called, it asks Go to guarantee that only this code executes on that thread (since Go is completely free to move stuff around when needed, at any point in time). That's the only way in which it can be guaranteed that ifgit_apply_options_init
happens to place any error information in the Thread-local storage,MakeGitError()
below can still find it.We may need to tweak
script/check-MakeGitError-thread-lock.go
to also complain if these functions don't happen before any cgo calls in the function to make this less error-prone.Fixed