MCPcopy
hub / github.com/etcd-io/bbolt / removeTx

Method removeTx

db.go:875–896  ·  view source on GitHub ↗

removeTx removes a transaction from the database.

(tx *Tx)

Source from the content-addressed store, hash-verified

873
874// removeTx removes a transaction from the database.
875func (db *DB) removeTx(tx *Tx) {
876 // Release the read lock on the mmap.
877 db.mmaplock.RUnlock()
878
879 // Use the meta lock to restrict access to the DB object.
880 db.metalock.Lock()
881
882 if db.freelist != nil {
883 db.freelist.RemoveReadonlyTXID(tx.meta.Txid())
884 }
885
886 // Unlock the meta pages.
887 db.metalock.Unlock()
888
889 // Merge statistics.
890 if db.stats != nil {
891 db.statlock.Lock()
892 db.stats.OpenTxN--
893 db.stats.TxStats.add(&tx.stats)
894 db.statlock.Unlock()
895 }
896}
897
898// Update executes a function within the context of a read-write managed transaction.
899// If no error is returned from the function then the transaction is committed.

Callers 1

closeMethod · 0.80

Calls 3

TxidMethod · 0.80
addMethod · 0.80
RemoveReadonlyTXIDMethod · 0.65

Tested by

no test coverage detected