Skip to content
This repository has been archived by the owner on Apr 6, 2019. It is now read-only.

Commit

Permalink
Fix std::atomic compilation errors (C2797) on msvc 2013. (#3)
Browse files Browse the repository at this point in the history
Avoid using typedef names over full specialization.
  • Loading branch information
navossoc authored and Cylix committed Feb 5, 2017
1 parent 5306cd9 commit 4c01116
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions includes/tacopie/network/io_service.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,14 @@ class io_service {

//! rd event
event_callback_t rd_callback;
std::atomic_bool is_executing_rd_callback = ATOMIC_VAR_INIT(false);
std::atomic<bool> is_executing_rd_callback = ATOMIC_VAR_INIT(false);

//! wr event
event_callback_t wr_callback;
std::atomic_bool is_executing_wr_callback = ATOMIC_VAR_INIT(false);
std::atomic<bool> is_executing_wr_callback = ATOMIC_VAR_INIT(false);

//! marked for untrack
std::atomic_bool marked_for_untrack = ATOMIC_VAR_INIT(false);
std::atomic<bool> marked_for_untrack = ATOMIC_VAR_INIT(false);
};

private:
Expand All @@ -110,7 +110,7 @@ class io_service {
std::unordered_map<fd_t, tracked_socket> m_tracked_sockets;

//! whether the worker should stop or not
std::atomic_bool m_should_stop;
std::atomic<bool> m_should_stop;

//! poll thread
std::thread m_poll_worker;
Expand Down
2 changes: 1 addition & 1 deletion includes/tacopie/network/tcp_client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class tcp_client {
tacopie::tcp_socket m_socket;

//! whether the client is currently connected or not
std::atomic_bool m_is_connected = ATOMIC_VAR_INIT(false);
std::atomic<bool> m_is_connected = ATOMIC_VAR_INIT(false);

//! read & write requests
std::queue<read_request> m_read_requests;
Expand Down
2 changes: 1 addition & 1 deletion includes/tacopie/network/tcp_server.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class tcp_server {
tacopie::tcp_socket m_socket;

//! whether the server is currently running or not
std::atomic_bool m_is_running = ATOMIC_VAR_INIT(false);
std::atomic<bool> m_is_running = ATOMIC_VAR_INIT(false);

//! clients
std::list<std::shared_ptr<tacopie::tcp_client>> m_clients;
Expand Down
2 changes: 1 addition & 1 deletion includes/tacopie/utils/thread_pool.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class thread_pool {
std::vector<std::thread> m_workers;

//! whether the thread_pool should stop or not
std::atomic_bool m_should_stop = ATOMIC_VAR_INIT(false);
std::atomic<bool> m_should_stop = ATOMIC_VAR_INIT(false);

//! tasks
std::queue<task_t> m_tasks;
Expand Down

0 comments on commit 4c01116

Please sign in to comment.