@@ -555,10 +555,12 @@ TEST(StaticReadWriteLockTest, ScopedWriteUnlockThreaded) {
555555template <typename RW> void readLockWhileReadLockedThreaded (RW &lock) {
556556 lock.readLock ();
557557
558- std::vector<std::atomic<bool >> results (10 );
558+ const int threadCount = 10 ;
559+
560+ std::atomic<bool > results[threadCount] = {};
559561
560562 std::atomic<bool > done (false );
561- threadedExecute (10 ,
563+ threadedExecute (threadCount ,
562564 [&](int index) {
563565 // Always perform at least one iteration of this loop to
564566 // avoid spurious failures if this thread is slow to run.
@@ -596,10 +598,12 @@ TEST(StaticReadWriteLockTest, ReadLockWhileReadLockedThreaded) {
596598template <typename RW> void readLockWhileWriteLockedThreaded (RW &lock) {
597599 lock.writeLock ();
598600
599- std::vector<std::atomic<int >> results (10 );
601+ const int threadCount = 10 ;
602+
603+ std::atomic<int > results[threadCount] = {};
600604
601605 std::atomic<bool > done (false );
602- threadedExecute (10 ,
606+ threadedExecute (threadCount ,
603607 [&](int index) {
604608 // Always perform at least one iteration of this loop to
605609 // avoid spurious failures if this thread is slow to run.
@@ -638,7 +642,7 @@ template <typename RW> void writeLockWhileReadLockedThreaded(RW &lock) {
638642
639643 const int threadCount = 10 ;
640644
641- std::vector<std:: atomic<int >> results ( threadCount) ;
645+ std::atomic<int > results[ threadCount] = {} ;
642646
643647 std::atomic<bool > done (false );
644648 threadedExecute (threadCount,
@@ -680,7 +684,7 @@ template <typename RW> void writeLockWhileWriteLockedThreaded(RW &lock) {
680684
681685 const int threadCount = 10 ;
682686
683- std::vector<std:: atomic<int >> results ( threadCount) ;
687+ std::atomic<int > results[ threadCount] = {} ;
684688
685689 std::atomic<bool > done (false );
686690 threadedExecute (threadCount,
@@ -753,7 +757,7 @@ template <typename RW> void tryReadLockWhileReadLockedThreaded(RW &lock) {
753757
754758 const int threadCount = 10 ;
755759
756- std::vector<std:: atomic<bool >> results ( threadCount) ;
760+ std::atomic<bool > results[ threadCount] = {} ;
757761
758762 std::atomic<bool > done (false );
759763 threadedExecute (threadCount,
0 commit comments