@@ -33,17 +33,17 @@ bool TimestampOrderingTransactionManager::SetLastReaderCommitId(
3333 // get the pointer to the last_reader_cid field.
3434 cid_t read_ts = tile_group_header->GetLastReaderCommitId (tuple_id);
3535
36- auto latch = tile_group_header->GetSpinLatch (tuple_id);
36+ auto & latch = tile_group_header->GetSpinLatch (tuple_id);
3737
38- latch-> Lock ();
38+ latch. Lock ();
3939
4040 txn_id_t tuple_txn_id = tile_group_header->GetTransactionId (tuple_id);
4141
4242 if (is_owner == false && tuple_txn_id != INITIAL_TXN_ID) {
4343 // if the write lock has already been acquired by some concurrent
4444 // transactions,
4545 // then return without setting the last_reader_cid.
46- latch-> Unlock ();
46+ latch. Unlock ();
4747 return false ;
4848 } else {
4949 // if current_cid is larger than the current value of last_reader_cid field,
@@ -52,7 +52,7 @@ bool TimestampOrderingTransactionManager::SetLastReaderCommitId(
5252 tile_group_header->SetLastReaderCommitId (tuple_id, current_cid);
5353 }
5454
55- latch-> Unlock ();
55+ latch. Unlock ();
5656 return true ;
5757 }
5858}
@@ -114,8 +114,8 @@ bool TimestampOrderingTransactionManager::AcquireOwnership(
114114 // to acquire the ownership,
115115 // we must guarantee that no transaction that has read
116116 // the tuple has a larger timestamp than the current transaction.
117- auto latch = tile_group_header->GetSpinLatch (tuple_id);
118- latch-> Lock ();
117+ auto & latch = tile_group_header->GetSpinLatch (tuple_id);
118+ latch. Lock ();
119119 // change timestamp
120120 cid_t last_reader_cid = tile_group_header->GetLastReaderCommitId (tuple_id);
121121
@@ -124,16 +124,16 @@ bool TimestampOrderingTransactionManager::AcquireOwnership(
124124 // consider a transaction that is executed under snapshot isolation.
125125 // in this case, commit_id is not equal to read_id.
126126 if (last_reader_cid > current_txn->GetCommitId ()) {
127- tile_group_header-> GetSpinLatch (tuple_id)-> Unlock ();
127+ latch. Unlock ();
128128
129129 return false ;
130130 } else {
131131 if (tile_group_header->SetAtomicTransactionId (tuple_id, txn_id) == false ) {
132- latch-> Unlock ();
132+ latch. Unlock ();
133133
134134 return false ;
135135 } else {
136- latch-> Unlock ();
136+ latch. Unlock ();
137137
138138 return true ;
139139 }
0 commit comments