volatile varibles in favor of std::atmoc<>
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
#include <condition_variable>
|
||||
#include <memory>
|
||||
#include <thread>
|
||||
#include <atomic>
|
||||
|
||||
namespace nana
|
||||
{
|
||||
@@ -340,7 +341,7 @@ namespace detail
|
||||
|
||||
private:
|
||||
Display * display_;
|
||||
volatile bool is_work_{ false };
|
||||
std::atomic<bool> is_work_{ false };
|
||||
std::unique_ptr<std::thread> thrd_;
|
||||
|
||||
struct table_tag
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
#include <nana/push_ignore_diagnostic>
|
||||
|
||||
#include <atomic>
|
||||
#include <thread>
|
||||
#include <mutex>
|
||||
#include <memory>
|
||||
@@ -268,7 +269,7 @@ namespace detail
|
||||
std::recursive_mutex xlib_locker_;
|
||||
struct caret_holder_tag
|
||||
{
|
||||
volatile bool exit_thread;
|
||||
std::atomic<bool> exit_thread;
|
||||
std::unique_ptr<std::thread> thr;
|
||||
std::map<native_window_type, caret_rep*> carets;
|
||||
}caret_holder_;
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace system
|
||||
: impl_(new impl_t)
|
||||
{}
|
||||
|
||||
timepiece::timepiece(const volatile timepiece& rhs)
|
||||
timepiece::timepiece(const timepiece& rhs)
|
||||
: impl_(new impl_t(*rhs.impl_))
|
||||
{}
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace system
|
||||
delete impl_;
|
||||
}
|
||||
|
||||
timepiece & timepiece::operator=(const volatile timepiece & rhs)
|
||||
timepiece & timepiece::operator=(const timepiece & rhs)
|
||||
{
|
||||
if(this != &rhs)
|
||||
*impl_ = *rhs.impl_;
|
||||
@@ -41,7 +41,7 @@ namespace system
|
||||
return *this;
|
||||
}
|
||||
|
||||
void timepiece::start() volatile
|
||||
void timepiece::start() noexcept
|
||||
{
|
||||
#if defined(NANA_WINDOWS)
|
||||
::QueryPerformanceCounter(&impl_->beg_timestamp);
|
||||
@@ -51,7 +51,7 @@ namespace system
|
||||
#endif
|
||||
}
|
||||
|
||||
double timepiece::calc() const volatile
|
||||
double timepiece::calc() const noexcept
|
||||
{
|
||||
#if defined(NANA_WINDOWS)
|
||||
LARGE_INTEGER li;
|
||||
|
||||
Reference in New Issue
Block a user