projects
/
invirt/third/libt4.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Got rid of most using directives. Ported tests to python.
[invirt/third/libt4.git]
/
handle.cc
diff --git
a/handle.cc
b/handle.cc
index
792ce40
..
926cb59
100644
(file)
--- a/
handle.cc
+++ b/
handle.cc
@@
-5,18
+5,18
@@
public:
unique_ptr<rpcc> client;
bool valid = true;
string destination;
unique_ptr<rpcc> client;
bool valid = true;
string destination;
- mutex client_mutex;
+ std::mutex client_mutex;
hinfo(const string & destination_) : destination(destination_) {}
};
hinfo(const string & destination_) : destination(destination_) {}
};
-static mutex mgr_mutex;
-static map<string, shared_ptr<hinfo>> hmap;
+static std::mutex mgr_mutex;
+static std::map<string, shared_ptr<hinfo>> hmap;
handle::handle(const string & destination) : destination_(destination) {
lock ml(mgr_mutex);
h = hmap[destination];
if (!h || !h->valid)
handle::handle(const string & destination) : destination_(destination) {
lock ml(mgr_mutex);
h = hmap[destination];
if (!h || !h->valid)
- h = (hmap[destination] = make_shared<hinfo>(destination));
+ h = (hmap[destination] = std::make_shared<hinfo>(destination));
}
rpcc * handle::safebind() {
}
rpcc * handle::safebind() {
@@
-27,14
+27,14
@@
rpcc * handle::safebind() {
return nullptr;
if (!h->client) {
unique_ptr<rpcc> client(new rpcc(h->destination));
return nullptr;
if (!h->client) {
unique_ptr<rpcc> client(new rpcc(h->destination));
- LOG("bind(\"" << h->destination << "\")");
+ LOG << "bind(\"" << h->destination << "\")";
int ret = client->bind(milliseconds(1000));
if (ret < 0) {
int ret = client->bind(milliseconds(1000));
if (ret < 0) {
- LOG("bind failure! " << h->destination << " " << ret);
+ LOG << "bind failure! " << h->destination << " " << ret;
h->valid = false;
} else {
h->valid = false;
} else {
- LOG("bind succeeded " << h->destination);
- h->client = move(client);
+ LOG << "bind succeeded " << h->destination;
+ h->client = std::move(client);
}
}
return h->client.get();
}
}
return h->client.get();
@@
-45,7
+45,7
@@
void handle::invalidate() {
lock ml(mgr_mutex);
if (hmap.find(destination_) != hmap.end()) {
hmap[destination_]->valid = false;
lock ml(mgr_mutex);
if (hmap.find(destination_) != hmap.end()) {
hmap[destination_]->valid = false;
- LOG_NONMEMBER("cl " << destination_ << " refcnt " << hmap[destination_].use_count());
+ LOG << "cl " << destination_ << " refcnt " << hmap[destination_].use_count();
hmap.erase(destination_);
}
}
hmap.erase(destination_);
}
}