diff options
author | Nicolas Noble <pixel@nobis-crew.org> | 2013-12-18 18:10:39 -0800 |
---|---|---|
committer | Nicolas Noble <pixel@nobis-crew.org> | 2013-12-18 18:10:39 -0800 |
commit | d489bcc2cba7c454874ae09e2e1df5d9dc6958aa (patch) | |
tree | dcf09d48f609fd7a7834e311663a3885b17459bf /includes/HttpServer.h | |
parent | 9e2b2679cb94ba4950aa98323e4c61a3e53546e2 (diff) |
Removing Atomic.h and all volatiles.
Diffstat (limited to 'includes/HttpServer.h')
-rw-r--r-- | includes/HttpServer.h | 8 |
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; }; |