mirror of
https://github.com/VSadov/Satori.git
synced 2025-06-08 03:27:04 +09:00
lock tweak
This commit is contained in:
parent
8cd5724a3a
commit
5317b471db
2 changed files with 22 additions and 1 deletions
21
src/coreclr/gc/env/volatile.h
vendored
21
src/coreclr/gc/env/volatile.h
vendored
|
@ -297,6 +297,27 @@ void VolatileStoreWithoutBarrier(T* pt, T val)
|
|||
#endif
|
||||
}
|
||||
|
||||
//
|
||||
// Memory ordering barrier that waits for loads in progress to complete.
|
||||
// Any effects of loads or stores that appear after, in program order, will "happen after" relative to this.
|
||||
// Other operations such as computation or instruction prefetch are not affected.
|
||||
//
|
||||
// Architectural mapping:
|
||||
// arm64 : dmb ishld
|
||||
// arm : dmb ish
|
||||
// x86/64 : compiler fence
|
||||
inline
|
||||
void VolatileLoadBarrier()
|
||||
{
|
||||
#if defined(HOST_ARM64) && defined(__GNUC__)
|
||||
asm volatile ("dmb ishld" : : : "memory");
|
||||
#elif defined(HOST_ARM64) && defined(_MSC_VER)
|
||||
__dmb(_ARM64_BARRIER_ISHLD);
|
||||
#else
|
||||
VOLATILE_MEMORY_BARRIER();
|
||||
#endif
|
||||
}
|
||||
|
||||
//
|
||||
// Volatile<T> implements accesses with our volatile semantics over a variable of type T.
|
||||
// Wherever you would have used a "volatile Foo" or, equivalently, "Foo volatile", use Volatile<Foo>
|
||||
|
|
|
@ -79,7 +79,7 @@ public:
|
|||
}
|
||||
|
||||
#if !defined(TARGET_AMD64)
|
||||
MemoryBarrier();
|
||||
VolatileLoadBarrier();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue