Skip to content

Commit 5d466ff

Browse files
committed
commit: add thread locking to signature extraction
1 parent 29c0b73 commit 5d466ff

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

commit.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,18 @@ func (c Commit) ExtractSignature() (string, string, error) {
3535
defer C.git_buf_free(&c_signature)
3636

3737
oid := c.Id()
38-
3938
repo := C.git_commit_owner(c.cast_ptr)
39+
40+
runtime.LockOSThread()
41+
defer runtime.UnlockOSThread()
4042
ret := C.git_commit_extract_signature(&c_signature, &c_signed, repo, oid.toC(), nil)
41-
43+
4244
if ret < 0 {
43-
return "", "", MakeGitError(ret)
45+
return "", "", MakeGitError(ret)
4446
} else {
4547
return C.GoString(c_signature.ptr), C.GoString(c_signed.ptr), nil
4648
}
47-
49+
4850
}
4951

5052
func (c Commit) Summary() string {

0 commit comments

Comments
 (0)