Index: include/lldb/Core/Communication.h =================================================================== --- include/lldb/Core/Communication.h +++ include/lldb/Core/Communication.h @@ -352,7 +352,7 @@ protected: lldb::ConnectionSP m_connection_sp; ///< The connection that is current in use by this communications class. HostThread m_read_thread; ///< The read thread handle in case we need to cancel the thread. - bool m_read_thread_enabled; + std::atomic m_read_thread_enabled; std::string m_bytes; ///< A buffer to cache bytes read in the ReadThread function. Mutex m_bytes_mutex; ///< A mutex to protect multi-threaded access to the cached bytes. Mutex m_write_mutex; ///< Don't let multiple threads write at the same time... Index: include/lldb/Core/ConnectionFileDescriptor.h =================================================================== --- include/lldb/Core/ConnectionFileDescriptor.h +++ include/lldb/Core/ConnectionFileDescriptor.h @@ -106,8 +106,8 @@ Pipe m_pipe; Mutex m_mutex; - bool m_shutting_down; // This marks that we are shutting down so if we get woken up from - // BytesAvailable to disconnect, we won't try to read again. + std::atomic m_shutting_down; // This marks that we are shutting down so if we get woken up from + // BytesAvailable to disconnect, we won't try to read again. bool m_waiting_for_accept; private: DISALLOW_COPY_AND_ASSIGN (ConnectionFileDescriptor); Index: include/lldb/Target/Process.h =================================================================== --- include/lldb/Target/Process.h +++ include/lldb/Target/Process.h @@ -3048,7 +3048,7 @@ uint32_t m_process_unique_id; ///< Each lldb_private::Process class that is created gets a unique integer ID that increments with each new instance uint32_t m_thread_index_id; ///< Each thread is created with a 1 based index that won't get re-used. std::map m_thread_id_to_index_id_map; - int m_exit_status; ///< The exit status of the process, or -1 if not set. + std::atomic m_exit_status; ///< The exit status of the process, or -1 if not set. std::string m_exit_string; ///< A textual description of why a process exited. Mutex m_thread_mutex; ThreadList m_thread_list_real; ///< The threads for this process as are known to the protocol we are debugging with Index: source/Plugins/Process/gdb-remote/ProcessGDBRemote.h =================================================================== --- source/Plugins/Process/gdb-remote/ProcessGDBRemote.h +++ source/Plugins/Process/gdb-remote/ProcessGDBRemote.h @@ -328,7 +328,7 @@ lldb_private::Flags m_flags; // Process specific flags (see eFlags enums) GDBRemoteCommunicationClient m_gdb_comm; - lldb::pid_t m_debugserver_pid; + std::atomic m_debugserver_pid; StringExtractorGDBRemote m_last_stop_packet; lldb_private::Mutex m_last_stop_packet_mutex; GDBRemoteDynamicRegisterInfo m_register_info; Index: source/lldb-log.cpp =================================================================== --- source/lldb-log.cpp +++ source/lldb-log.cpp @@ -27,7 +27,7 @@ // that will construct the static g_lob_sp the first time this function is // called. -static bool g_log_enabled = false; +static std::atomic g_log_enabled {false}; static Log * g_log = NULL; static Log * GetLog ()