This revision was automatically updated to reflect the committed changes.
Closed by commit rL332115: Add a lock to PlatformPOSIX::DoLoadImage (authored
by friss, committed by ).
Herald added a subscriber: llvm-commits.
Changed prior to commit:
https://reviews.llvm.org/D46733?vs=146268&id=146368
clayborg accepted this revision.
clayborg added a comment.
This revision is now accepted and ready to land.
Much better.
https://reviews.llvm.org/D46733
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/
jingham accepted this revision.
jingham added a comment.
That looks fine to me.
https://reviews.llvm.org/D46733
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
friss updated this revision to Diff 146268.
friss added a comment.
I heted the idea of hosting the once_flag in Process but using
it in PlatformPOSIX. I did a bigger refactoring where platforms
pass a factory lambda to the accessor and the thread-safe init
is done in the Process class itself using
clayborg added inline comments.
Comment at: source/Plugins/Platform/POSIX/PlatformPOSIX.cpp:1047
+static std::mutex do_dlopen_mutex;
+std::lock_guard lock(do_dlopen_mutex);
+
Accessor would be fine. The other reason for putting this in the process is
mul
friss added inline comments.
Comment at: source/Plugins/Platform/POSIX/PlatformPOSIX.cpp:1046-1047
+ {
+static std::mutex do_dlopen_mutex;
+std::lock_guard lock(do_dlopen_mutex);
+
clayborg wrote:
> We should put the mutex, or better yet a std::once_flag
clayborg requested changes to this revision.
clayborg added inline comments.
This revision now requires changes to proceed.
Comment at: source/Plugins/Platform/POSIX/PlatformPOSIX.cpp:1046-1047
+ {
+static std::mutex do_dlopen_mutex;
+std::lock_guard lock(do_dlopen_mutex
friss created this revision.
friss added a reviewer: jingham.
Herald added a subscriber: emaste.
Multiple threads could be calling into DoLoadImage concurrently,
only one should be allowed to create the UtilityFunction.
https://reviews.llvm.org/D46733
Files:
source/Plugins/Platform/POSIX/Plat