- The NegCache and MemRecursorCache destructors were not deadlock free
when running from testrunner. The purpose of the code in the dts
is also unclear, so delete them.
- quit-nicely uses a volatile sig_atomic_t, which is not thread-safe
according to tsan. Replace by atomic.
#include "namespaces.hh"
-volatile sig_atomic_t RecursorControlChannel::stop = 0;
+std::atomic<bool> RecursorControlChannel::stop = false;
RecursorControlChannel::RecursorControlChannel()
{
RecursorControlChannel::Answer recv(std::string* remote = nullptr, unsigned int timeout = 5);
int d_fd;
- static volatile sig_atomic_t stop;
+ static std::atomic<bool> stop;
private:
struct sockaddr_un d_local;
if(!s_pidfname.empty())
unlink(s_pidfname.c_str()); // we can at least try..
if(nicely) {
- RecursorControlChannel::stop = 1;
+ RecursorControlChannel::stop = true;
} else {
_exit(1);
}
{
}
-MemRecursorCache::~MemRecursorCache()
-{
- try {
- typedef std::unique_ptr<lock> lock_t;
- vector<lock_t> locks;
- for (auto& map : d_maps) {
- locks.push_back(lock_t(new lock(map)));
- }
- }
- catch(...) {
- }
-}
-
size_t MemRecursorCache::size()
{
size_t count = 0;
{
public:
MemRecursorCache(size_t mapsCount = 1024);
- ~MemRecursorCache();
size_t size();
size_t bytes();
{
}
-NegCache::~NegCache()
-{
- try {
- typedef std::unique_ptr<lock> lock_t;
- vector<lock_t> locks;
- for (auto& map : d_maps) {
- locks.push_back(lock_t(new lock(map)));
- }
- }
- catch (...) {
- }
-}
-
size_t NegCache::size() const
{
size_t count = 0;
{
public:
NegCache(size_t mapsCount = 1024);
- ~NegCache();
struct NegCacheEntry
{