summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp
diff options
context:
space:
mode:
authorTodd Fiala <todd.fiala@gmail.com>2014-09-15 20:07:33 +0000
committerTodd Fiala <todd.fiala@gmail.com>2014-09-15 20:07:33 +0000
commit7b0917a0c5a7b015e521c2ea719fdddc7f7b0d66 (patch)
tree03189805e0fb8976aaca4c1acd461075b0a6aff5 /lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp
parent52550349827a1b836de87ec83689fa89b1d208f0 (diff)
downloadbcm5719-llvm-7b0917a0c5a7b015e521c2ea719fdddc7f7b0d66.tar.gz
bcm5719-llvm-7b0917a0c5a7b015e521c2ea719fdddc7f7b0d66.zip
use std::atomic<> to protect variables being accessed by multiple threads
There are several places where multiple threads are accessing the same variables simultaneously without any kind of protection. I propose using std::atomic<> to make it safer. I did a special build of lldb, using the google tool 'thread sanitizer' which identified many cases of multiple threads accessing the same memory. std::atomic is low overhead and does not use any locks for simple types such as int/bool. See http://reviews.llvm.org/D5302 for more details. Change by Shawn Best. llvm-svn: 217818
Diffstat (limited to 'lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp')
-rw-r--r--lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp b/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp
index 4b488444de1..5a0b5ed1419 100644
--- a/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp
+++ b/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp
@@ -258,8 +258,7 @@ ProcessFreeBSD::SendMessage(const ProcessMessage &message)
case ProcessMessage::eLimboMessage:
case ProcessMessage::eExitMessage:
- m_exit_status = message.GetExitStatus();
- SetExitStatus(m_exit_status, NULL);
+ SetExitStatus(message.GetExitStatus(), NULL);
break;
case ProcessMessage::eSignalMessage:
OpenPOWER on IntegriCloud