Remove preinitializeOnForeignThread

This commit is contained in:
Andrew Noyes 2021-06-23 14:33:41 -07:00
parent 7f35a66383
commit d69fda1d2e
4 changed files with 4 additions and 10 deletions

View File

@ -27,7 +27,6 @@
ISingleThreadTransaction* ISingleThreadTransaction::allocateOnForeignThread(Type type) {
if (type == Type::RYW) {
auto tr = new ReadYourWritesTransaction;
tr->preinitializeOnForeignThread();
return tr;
} else if (type == Type::SIMPLE_CONFIG) {
auto tr = new SimpleConfigTransaction;
@ -43,12 +42,15 @@ ISingleThreadTransaction* ISingleThreadTransaction::allocateOnForeignThread(Type
void ISingleThreadTransaction::create(ISingleThreadTransaction* tr, Type type, Database db) {
switch (type) {
case Type::RYW:
dynamic_cast<ReadYourWritesTransaction*>(tr)->~ReadYourWritesTransaction();
new (tr) ReadYourWritesTransaction(db);
break;
case Type::SIMPLE_CONFIG:
dynamic_cast<SimpleConfigTransaction*>(tr)->~SimpleConfigTransaction();
new (tr) SimpleConfigTransaction(db);
break;
case Type::PAXOS_CONFIG:
dynamic_cast<PaxosConfigTransaction*>(tr)->~PaxosConfigTransaction();
new (tr) PaxosConfigTransaction(db);
break;
default:

View File

@ -241,8 +241,6 @@ public:
explicit Transaction(Database const& cx);
~Transaction();
void preinitializeOnForeignThread() { committedVersion = invalidVersion; }
void setVersion(Version v);
Future<Version> getReadVersion() { return getReadVersion(0); }
Future<Version> getRawReadVersion();
@ -418,7 +416,7 @@ private:
Database cx;
double backoff;
Version committedVersion;
Version committedVersion{ invalidVersion };
CommitTransactionRequest tr;
Future<Version> readVersion;
Promise<Optional<Value>> metadataVersion;

View File

@ -1729,10 +1729,6 @@ void ReadYourWritesTransaction::getWriteConflicts(KeyRangeMap<bool>* result) {
}
}
void ReadYourWritesTransaction::preinitializeOnForeignThread() {
tr.preinitializeOnForeignThread();
}
void ReadYourWritesTransaction::setTransactionID(uint64_t id) {
tr.setTransactionID(id);
}

View File

@ -153,8 +153,6 @@ public:
void getWriteConflicts(KeyRangeMap<bool>* result) override;
void preinitializeOnForeignThread();
Database getDatabase() const { return tr.getDatabase(); }
const TransactionInfo& getTransactionInfo() const { return tr.info; }