summaryrefslogtreecommitdiff
path: root/config.go
diff options
context:
space:
mode:
authorCarlos Martín Nieto <[email protected]>2014-12-06 02:44:57 +0100
committerCarlos Martín Nieto <[email protected]>2014-12-06 02:45:26 +0100
commit8c631b0c25c8de616afa2fd89378299c9d9a1439 (patch)
tree4f37d5612f17bc13a0a3d1b71019711430eab0c4 /config.go
parent0ec2f4665913a37df6f4d5704ea3a69bae2eb8b3 (diff)
Add missing thread locking
Diffstat (limited to 'config.go')
-rw-r--r--config.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/config.go b/config.go
index 5bcb0f8..bbf03e2 100644
--- a/config.go
+++ b/config.go
@@ -235,6 +235,10 @@ func (c *Config) SetInt32(name string, value int32) (err error) {
cname := C.CString(name)
defer C.free(unsafe.Pointer(cname))
+
+ runtime.LockOSThread()
+ defer runtime.UnlockOSThread()
+
ret := C.git_config_set_int32(c.ptr, cname, C.int32_t(value))
if ret < 0 {
return MakeGitError(ret)
@@ -350,6 +354,9 @@ type ConfigIterator struct {
func (iter *ConfigIterator) Next() (*ConfigEntry, error) {
var centry *C.git_config_entry
+ runtime.LockOSThread()
+ defer runtime.UnlockOSThread()
+
ret := C.git_config_next(&centry, iter.ptr)
if ret < 0 {
return nil, MakeGitError(ret)