diff options
author | Brad Fitzpatrick <bradfitz@golang.org> | 2013-03-14 15:01:45 -0700 |
---|---|---|
committer | Brad Fitzpatrick <bradfitz@golang.org> | 2013-03-14 15:01:45 -0700 |
commit | 319156fd01daec847d0bb94c61ddb4094b79c784 (patch) | |
tree | 7803432ea59d79c793d1463233d2a62c0d8f1ba4 /misc/dashboard | |
parent | f7e5004b612e28251d8cf1147832cb95977c11c1 (diff) | |
download | go-319156fd01daec847d0bb94c61ddb4094b79c784.tar.gz |
database/sql: associate a mutex with each driver interface
The database/sql/driver docs make this promise:
"Conn is a connection to a database. It is not used
concurrently by multiple goroutines."
That promises exists as part of database/sql's overall
goal of making drivers relatively easy to write.
So far this promise has been kept without the use of locks by
being careful in the database/sql package, but sometimes too
careful. (cf. golang.org/issue/3857)
The CL associates a Mutex with each driver.Conn, and with the
interface value progeny thereof. (e.g. each driver.Tx,
driver.Stmt, driver.Rows, driver.Result, etc) Then whenever
those interface values are used, the Locker is locked.
This CL should be a no-op (aside from some new Lock/Unlock
pairs) and doesn't attempt to fix Issue 3857 or Issue 4459,
but should make it much easier in a subsequent CL.
Update issue 3857
R=golang-dev, adg
CC=golang-dev
https://codereview.appspot.com/7803043
Diffstat (limited to 'misc/dashboard')
0 files changed, 0 insertions, 0 deletions