Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
KRM7 committed Sep 22, 2023
1 parent 8f8267d commit e3a2f40
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/utility/shared_spinlock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,13 @@ namespace gapp::detail
void lock() noexcept
{
lock_.lock();
while (read_cnt_.load(std::memory_order_relaxed)) GAPP_PAUSE();
std::atomic_thread_fence(std::memory_order_acquire);
//while (read_cnt_.load(std::memory_order_relaxed)) GAPP_PAUSE();
//std::atomic_thread_fence(std::memory_order_acquire);
while (true)
{
if (!read_cnt_.load(std::memory_order_acquire)) break;
while (read_cnt_.load(std::memory_order_relaxed)) GAPP_PAUSE();
}
}

bool try_lock() noexcept
Expand Down

0 comments on commit e3a2f40

Please sign in to comment.