From 7fb06feea4012543b6a1b0726a09e9a4c4a84933 Mon Sep 17 00:00:00 2001 From: Ben Johnson Date: Sat, 15 Feb 2014 21:50:34 -0700 Subject: Add parallel usage test and race detector. --- transaction.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'transaction.go') 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)) } -- cgit v1.2.3