Skip to content

Commit 7e59646

Browse files
committed
rename uniq_ptr
1 parent 43647ed commit 7e59646

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

tests/dtmbench.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@ using namespace std;
1818
using namespace pqxx;
1919

2020
template<class T>
21-
class unique_ptr
21+
class my_unique_ptr
2222
{
2323
T* ptr;
2424

2525
public:
26-
unique_ptr(T* p = NULL) : ptr(p) {}
27-
~unique_ptr() { delete ptr; }
26+
my_unique_ptr(T* p = NULL) : ptr(p) {}
27+
~my_unique_ptr() { delete ptr; }
2828
T& operator*() { return *ptr; }
2929
T* operator->() { return ptr; }
3030
void operator=(T* p) { ptr = p; }
31-
void operator=(unique_ptr& other) {
31+
void operator=(my_unique_ptr& other) {
3232
ptr = other.ptr;
3333
other.ptr = NULL;
3434
}
@@ -115,7 +115,7 @@ xid_t execQuery( transaction_base& txn, char const* sql, ...)
115115
void* reader(void* arg)
116116
{
117117
thread& t = *(thread*)arg;
118-
vector< unique_ptr<connection> > conns(cfg.connections.size());
118+
vector< my_unique_ptr<connection> > conns(cfg.connections.size());
119119
for (size_t i = 0; i < conns.size(); i++) {
120120
conns[i] = new connection(cfg.connections[i]);
121121
}
@@ -132,8 +132,8 @@ void* reader(void* arg)
132132
}
133133
txn.commit();
134134
}
135-
vector< unique_ptr<nontransaction> > txns(conns.size());
136-
vector< unique_ptr<pipeline> > pipes(conns.size());
135+
vector< my_unique_ptr<nontransaction> > txns(conns.size());
136+
vector< my_unique_ptr<pipeline> > pipes(conns.size());
137137
vector<pipeline::query_id> results(conns.size());
138138
for (size_t i = 0; i < conns.size(); i++) {
139139
txns[i] = new nontransaction(*conns[i]);
@@ -196,8 +196,10 @@ void* writer(void* arg)
196196

197197
pipeline srcPipe(srcTx);
198198
pipeline dstPipe(dstTx);
199+
199200
srcPipe.insert("commit transaction");
200201
dstPipe.insert("commit transaction");
202+
201203
srcPipe.complete();
202204
dstPipe.complete();
203205

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy