diff options
author | Ben Johnson <benbjohnson@yahoo.com> | 2014-02-15 22:09:35 -0700 |
---|---|---|
committer | Ben Johnson <benbjohnson@yahoo.com> | 2014-02-15 22:09:35 -0700 |
commit | 3f0daf11ca5f232baa9a891b4301822d2b0cbeeb (patch) | |
tree | 057b2bf9d7487343f477f62726919421dc66b6b6 /transaction.go | |
parent | Merge pull request #32 from benbjohnson/blocks (diff) | |
parent | Add parallel usage test and race detector. (diff) | |
download | dedo-3f0daf11ca5f232baa9a891b4301822d2b0cbeeb.tar.gz dedo-3f0daf11ca5f232baa9a891b4301822d2b0cbeeb.tar.xz |
Merge pull request #34 from benbjohnson/multithreading
Race Detection
Diffstat (limited to 'transaction.go')
-rw-r--r-- | transaction.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/transaction.go b/transaction.go index 713a019..46adefe 100644 --- a/transaction.go +++ b/transaction.go @@ -20,9 +20,13 @@ type txnid uint64 // init initializes the transaction and associates it with a database. func (t *Transaction) init(db *DB) { t.db = db - t.meta = db.meta() t.pages = nil + // Copy the meta page since it can be changed by the writer. + t.meta = &meta{} + db.meta().copy(t.meta) + + // Read in the buckets page. t.buckets = &buckets{} t.buckets.read(t.page(t.meta.buckets)) } |