@@ -555,10 +555,12 @@ TEST(StaticReadWriteLockTest, ScopedWriteUnlockThreaded) {
555
555
template <typename RW> void readLockWhileReadLockedThreaded (RW &lock) {
556
556
lock.readLock ();
557
557
558
- std::vector<std::atomic<bool >> results (10 );
558
+ const int threadCount = 10 ;
559
+
560
+ std::atomic<bool > results[threadCount] = {};
559
561
560
562
std::atomic<bool > done (false );
561
- threadedExecute (10 ,
563
+ threadedExecute (threadCount ,
562
564
[&](int index) {
563
565
// Always perform at least one iteration of this loop to
564
566
// avoid spurious failures if this thread is slow to run.
@@ -596,10 +598,12 @@ TEST(StaticReadWriteLockTest, ReadLockWhileReadLockedThreaded) {
596
598
template <typename RW> void readLockWhileWriteLockedThreaded (RW &lock) {
597
599
lock.writeLock ();
598
600
599
- std::vector<std::atomic<int >> results (10 );
601
+ const int threadCount = 10 ;
602
+
603
+ std::atomic<int > results[threadCount] = {};
600
604
601
605
std::atomic<bool > done (false );
602
- threadedExecute (10 ,
606
+ threadedExecute (threadCount ,
603
607
[&](int index) {
604
608
// Always perform at least one iteration of this loop to
605
609
// avoid spurious failures if this thread is slow to run.
@@ -638,7 +642,7 @@ template <typename RW> void writeLockWhileReadLockedThreaded(RW &lock) {
638
642
639
643
const int threadCount = 10 ;
640
644
641
- std::vector<std:: atomic<int >> results ( threadCount) ;
645
+ std::atomic<int > results[ threadCount] = {} ;
642
646
643
647
std::atomic<bool > done (false );
644
648
threadedExecute (threadCount,
@@ -680,7 +684,7 @@ template <typename RW> void writeLockWhileWriteLockedThreaded(RW &lock) {
680
684
681
685
const int threadCount = 10 ;
682
686
683
- std::vector<std:: atomic<int >> results ( threadCount) ;
687
+ std::atomic<int > results[ threadCount] = {} ;
684
688
685
689
std::atomic<bool > done (false );
686
690
threadedExecute (threadCount,
@@ -753,7 +757,7 @@ template <typename RW> void tryReadLockWhileReadLockedThreaded(RW &lock) {
753
757
754
758
const int threadCount = 10 ;
755
759
756
- std::vector<std:: atomic<bool >> results ( threadCount) ;
760
+ std::atomic<bool > results[ threadCount] = {} ;
757
761
758
762
std::atomic<bool > done (false );
759
763
threadedExecute (threadCount,
0 commit comments