Commit graph

9 commits

Author SHA1 Message Date
56ee5c3aed Tweak compare_exchange_weak(...) in spin-lock
All checks were successful
Publish doxygen documentation to seodisparate.com / doxygen-gen-and-publish (push) Successful in 0s
2024-01-12 13:32:05 +09:00
4917fc47f6 Don't fail on "try" fns if failed to get spinLock
In SharedSpinLock: Only fail on "try" fns after spinLock was acquired
and condition is not met.
2024-01-12 13:32:05 +09:00
a0f8bf0b41 Refactor shared-spin-lock to use atomic "spinLock" 2024-01-12 13:32:05 +09:00
d1354b13d5 Minor refactorings 2024-01-12 13:32:05 +09:00
05087406b1 Reland C++11 "shared_lock" with iter remove fix
On iterator remove, the iterator will trade the read lock for a write
lock, and trade back for a read lock once the remove has been completed.
2024-01-12 13:32:05 +09:00
611287b377 Revert "Impl "RWLock" for use in TSLQueue"
This reverts commit cf27a6bb76.

The use of "shared_lock" in TSLQueue is unsafe because of two things:

  - The TSLQueue iterator takes a "read" lock.
  - The TSLQueue iterator can erase the current element.
2023-07-22 17:28:33 +09:00
ce092f81f9 Revert "Replace unnecessary use of atomic in "shared_lock""
This reverts commit b50e50b5fb.
2023-07-22 17:28:13 +09:00
b50e50b5fb Replace unnecessary use of atomic in "shared_lock" 2023-07-22 16:46:38 +09:00
cf27a6bb76 Impl "RWLock" for use in TSLQueue
This project supports C++11, and std::shared_lock was made available in
C++17, thus a "shared_spin_lock" was created with similar functionality.
This "shared_spin_lock" is used in TSLQueue.
2023-07-22 16:33:09 +09:00