aboutsummaryrefslogtreecommitdiff
path: root/sqlite3.go
diff options
context:
space:
mode:
authormattn <mattn.jp@gmail.com>2018-11-22 01:49:42 +0900
committerGitHub <noreply@github.com>2018-11-22 01:49:42 +0900
commit6a9185d7b1f12363e2c904449d374b63b6093b16 (patch)
tree411638e2fae68cd716fd12868bb8692dc502a84b /sqlite3.go
parentMerge pull request #643 from akalin/zero-length-blob (diff)
parentFix data race in AutoCommit() (diff)
downloadgolite-6a9185d7b1f12363e2c904449d374b63b6093b16.tar.gz
golite-6a9185d7b1f12363e2c904449d374b63b6093b16.tar.xz
Merge pull request #626 from otoolep/fix_data_race
Fix data race in AutoCommit()
Diffstat (limited to 'sqlite3.go')
-rw-r--r--sqlite3.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/sqlite3.go b/sqlite3.go
index df3258a..4e94256 100644
--- a/sqlite3.go
+++ b/sqlite3.go
@@ -740,6 +740,8 @@ func (c *SQLiteConn) RegisterAggregator(name string, impl interface{}, pure bool
// AutoCommit return which currently auto commit or not.
func (c *SQLiteConn) AutoCommit() bool {
+ c.mu.Lock()
+ defer c.mu.Unlock()
return int(C.sqlite3_get_autocommit(c.db)) != 0
}