Skip to content

Commit b64f075

Browse files
committed
---
yaml --- r: 347481 b: refs/heads/master c: 6a5dc6c h: refs/heads/master i: 347479: 9540b73
1 parent 6f66bb6 commit b64f075

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 2448c6a97e8c25b434b3a273404ae4e4c6f7d7a7
2+
refs/heads/master: 6a5dc6cb65f8cde734b3a0a8dccbc7d5cee369e0
33
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

trunk/unittests/runtime/Mutex.cpp

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -555,10 +555,12 @@ TEST(StaticReadWriteLockTest, ScopedWriteUnlockThreaded) {
555555
template <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) {
596598
template <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

Comments
 (0)