#include "spinlock.hpp"
◆ value_type
◆ shared_spinlockbase() [1/3]
458 {
460#if QUICKCPPLIB_IN_THREAD_SANITIZER
462#endif
463 }
#define QUICKCPPLIB_ANNOTATE_RWLOCK_CREATE(p)
Definition config.hpp:102
Definition spinlock.hpp:443
atomic< value_type > _v
Definition spinlock.hpp:450
◆ shared_spinlockbase() [2/3]
◆ shared_spinlockbase() [3/3]
Atomically move constructs.
468 {
470
471#if QUICKCPPLIB_IN_THREAD_SANITIZER
473#endif
474 }
◆ ~shared_spinlockbase()
476 {
477#ifdef QUICKCPPLIB_ENABLE_VALGRIND
480 {
482 }
484 {
486 }
487#endif
489 }
#define QUICKCPPLIB_ANNOTATE_RWLOCK_DESTROY(p)
Definition config.hpp:103
#define QUICKCPPLIB_ANNOTATE_RWLOCK_RELEASED(p, s)
Definition config.hpp:105
T value_type
Definition spinlock.hpp:447
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ load()
Returns the raw atomic.
493{
return _v.load(
o); }
◆ store()
◆ try_lock()
Tries to lock the spinlock for exclusive access, returning true if successful.
499 {
501
503 return false;
506 {
508 return true;
509 }
510 return false;
511 }
#define QUICKCPPLIB_ANNOTATE_RWLOCK_ACQUIRED(p, s)
Definition config.hpp:104
◆ unlock()
Releases the lock from exclusive access.
◆ try_lock_shared()
Tries to lock the spinlock for shared access, returning true if successful.
522 {
523
526 return false;
527
532 return true;
533 }
◆ unlock_shared()
Releases the lock from shared access.
536 {
538 for(
size_t n = 0;;
n++)
539 {
541
543 break;
544
546 {
547 for(
size_t m = 0;
m < 15000;
m =
m + 1)
548 {
551 }
552 }
553 }
558 }
◆ try_convert_lock_to_shared()
Tries to convert an exclusive lock to a shared lock, returning true if successful.
◆ try_convert_lock_to_exclusive()
Tries to convert a shared lock to an exclusive lock, returning true if successful.
◆ int_yield()
◆ _v
The documentation for this struct was generated from the following file: