diff options
Diffstat (limited to 'walk.go')
| -rw-r--r-- | walk.go | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -1,7 +1,6 @@ package git /* -#cgo pkg-config: libgit2 #include <git2.h> #include <git2/errors.h> */ @@ -9,6 +8,7 @@ import "C" import ( "io" + "runtime" ) // RevWalk @@ -35,6 +35,9 @@ func (v *RevWalk) Push(id *Oid) { } func (v *RevWalk) PushHead() (err error) { + runtime.LockOSThread() + defer runtime.UnlockOSThread() + ecode := C.git_revwalk_push_head(v.ptr) if ecode < 0 { err = LastError() @@ -44,6 +47,9 @@ func (v *RevWalk) PushHead() (err error) { } func (v *RevWalk) Next(oid *Oid) (err error) { + runtime.LockOSThread() + defer runtime.UnlockOSThread() + ret := C.git_revwalk_next(oid.toC(), v.ptr) switch { case ret == ITEROVER: |
