[PATCH] D54664: [tsan] Add __cxa_guard_acquire hooks to support cooperative scheduling

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 19 11:01:03 PST 2018


vitalybuka added a comment.

In https://reviews.llvm.org/D54664#1302072, @krytarowski wrote:

> Is this Linux-only?


Should apply to anything with __cxa_guard_acquire interceptor.



================
Comment at: compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:880
+  OnCxaGuardAcquireEnter();
+  auto on_exit = at_scope_exit(&OnCxaGuardAcquireExit);
   for (;;) {
----------------
dvyukov wrote:
> dvyukov wrote:
> > For my education, why can't at_scope_exit call the function 2 or 3 times? Can't it create 2 or 3 copies of RunOnDestruction, each of which will call the function?
> Don't we need to define move constructor for RunOnDestruction, delete copy constructor and all that stuff?
That's https://en.cppreference.com/w/cpp/language/copy_elision
If I read this correctly "required" section applies to this case.


Repository:
  rL LLVM

https://reviews.llvm.org/D54664





More information about the llvm-commits mailing list