Skip to content

Commit

Permalink
minor build fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kentslaney committed Dec 13, 2023
1 parent b7305ca commit c936fdf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions include/ClientPool.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ void duplicate_strings(const char* const * strs, const size_t n,
std::vector<std::array<char, N> >& out, std::vector<char*>& refs) {
out.resize(n);
refs.resize(n);
for (int i = 0; i < n; i++) {
for (size_t i = 0; i < n; i++) {
if (strs == NULL || strs[i] == NULL) {
out[i][0] = '\0';
refs[i] = NULL;
continue;
}
std::snprintf(out[i].data(), N, "%s", strs[i]);
refs[i] = &out[i];
refs[i] = out[i].data();
}
}

Expand Down
2 changes: 1 addition & 1 deletion include/LockPool.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class LockPool : OrderedLock {
m_waiting = unlock();
}

size_t workerIndex(const std::mutex** worker) {
size_t workerIndex(std::mutex** worker) {
return worker - m_thread_workers.data();
}
};
Expand Down
6 changes: 4 additions & 2 deletions src/ClientPool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ClientPool::ClientPool(): m_initial_clients(1), m_max_clients(4), m_max_growth(4
memset(m_opt_value, 0, sizeof m_opt_value);
}

ClientPool::ClientPool() {
ClientPool::~ClientPool() {
}

void ClientPool::config(config_options_t opt, int val) {
Expand Down Expand Up @@ -75,7 +75,7 @@ int ClientPool::setup(Client* c) {
c->config(static_cast<config_options_t>(i), m_opt_value[i]);
}
}
c->init(m_hosts.data(), m_ports.data(), m_hosts.size(), m_aliases.data());
return c->init(m_hosts.data(), m_ports.data(), m_hosts.size(), m_aliases.data());
}

// if called outside acquire, needs to own m_acquiring_growth
Expand All @@ -93,6 +93,8 @@ int ClientPool::growPool(size_t by) {
rv.store(err, std::memory_order_relaxed);
}
});
// adds workers with non-zero return values
// if changed, acquire should probably raise rather than hang
addWorkers(by);
return rv;
}
Expand Down

0 comments on commit c936fdf

Please sign in to comment.