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

Fix std::atomic compilation errors (C2797) on msvc 2013 (again) #3

Merged
merged 1 commit into from
Feb 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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