File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -167,7 +167,7 @@ type SQLiteDriver struct {
167
167
168
168
// SQLiteConn implement sql.Conn.
169
169
type SQLiteConn struct {
170
- dbMu sync.Mutex
170
+ mu sync.Mutex
171
171
db * C.sqlite3
172
172
loc * time.Location
173
173
txlock string
@@ -197,6 +197,7 @@ type SQLiteResult struct {
197
197
198
198
// SQLiteRows implement sql.Rows.
199
199
type SQLiteRows struct {
200
+ mu sync.Mutex
200
201
s * SQLiteStmt
201
202
nc int
202
203
cols []string
@@ -761,9 +762,9 @@ func (c *SQLiteConn) Close() error {
761
762
return c .lastError ()
762
763
}
763
764
deleteHandles (c )
764
- c .dbMu .Lock ()
765
+ c .mu .Lock ()
765
766
c .db = nil
766
- c .dbMu .Unlock ()
767
+ c .mu .Unlock ()
767
768
runtime .SetFinalizer (c , nil )
768
769
return nil
769
770
}
@@ -772,8 +773,8 @@ func (c *SQLiteConn) dbConnOpen() bool {
772
773
if c == nil {
773
774
return false
774
775
}
775
- c .dbMu .Lock ()
776
- defer c .dbMu .Unlock ()
776
+ c .mu .Lock ()
777
+ defer c .mu .Unlock ()
777
778
return c .db != nil
778
779
}
779
780
@@ -980,7 +981,10 @@ func (rc *SQLiteRows) Close() error {
980
981
return nil
981
982
}
982
983
if rc .done != nil {
984
+ rc .mu .Lock ()
983
985
close (rc .done )
986
+ rc .done = nil
987
+ rc .mu .Unlock ()
984
988
}
985
989
if rc .cls {
986
990
return rc .s .Close ()
File renamed without changes.
You can’t perform that action at this time.
0 commit comments