summaryrefslogtreecommitdiff
path: root/includes/HttpServer.h
diff options
context:
space:
mode:
authorNicolas Noble <pixel@nobis-crew.org>2013-12-18 18:10:39 -0800
committerNicolas Noble <pixel@nobis-crew.org>2013-12-18 18:10:39 -0800
commitd489bcc2cba7c454874ae09e2e1df5d9dc6958aa (patch)
treedcf09d48f609fd7a7834e311663a3885b17459bf /includes/HttpServer.h
parent9e2b2679cb94ba4950aa98323e4c61a3e53546e2 (diff)
Removing Atomic.h and all volatiles.
Diffstat (limited to 'includes/HttpServer.h')
-rw-r--r--includes/HttpServer.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/includes/HttpServer.h b/includes/HttpServer.h
index 55950cb..d044e92 100644
--- a/includes/HttpServer.h
+++ b/includes/HttpServer.h
@@ -2,8 +2,8 @@
#include <map>
#include <list>
+#include <atomic>
-#include <Atomic.h>
#include <BString.h>
#include <BRegex.h>
#include <Exceptions.h>
@@ -52,13 +52,13 @@ class HttpServer {
Regex::Captures uri, host;
};
ActionMatch matches(const char * uri, const char * host);
- void unref() { if (Atomic::Decrement(&m_refCount) == 0) delete this; }
- void ref() { Atomic::Increment(&m_refCount); }
+ void unref() { if (--m_refCount == 0) delete this; }
+ void ref() { ++m_refCount; }
void registerMe(HttpServer * server) { server->registerAction(this); }
virtual bool Do(HttpServer * server, Http::Request & req, ActionMatch & match, IO<Handle> out) throw (GeneralException) = 0;
private:
const Regex m_regex, m_host;
- volatile int m_refCount;
+ std::atomic<int> m_refCount;
Action(const Action &) = delete;
Action & operator=(const Action &) = delete;
};