From 8bda440bb919b6b59ce24de8f077dc31211e3f5a Mon Sep 17 00:00:00 2001 From: pcbro <2bux89+dk3zspjmuh16o@sharklasers.com> Date: Fri, 4 Dec 2015 10:01:57 +0000 Subject: [PATCH] Fix inconsiderate naming --- .../stdlib/StringSlicesConcurrentAppend.swift | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/validation-test/stdlib/StringSlicesConcurrentAppend.swift b/validation-test/stdlib/StringSlicesConcurrentAppend.swift index 52c36b21ce54a..ac95cbab58ef5 100644 --- a/validation-test/stdlib/StringSlicesConcurrentAppend.swift +++ b/validation-test/stdlib/StringSlicesConcurrentAppend.swift @@ -25,13 +25,13 @@ extension String { // different non-shared strings that point to the same shared buffer. enum ThreadID { - case Master - case Slave + case Leader + case Follower } var barrierVar: UnsafeMutablePointer<_stdlib_pthread_barrier_t> = nil var sharedString: String = "" -var slaveString: String = "" +var followerString: String = "" func barrier() { var ret = _stdlib_pthread_barrier_wait(barrierVar) @@ -41,7 +41,7 @@ func barrier() { func sliceConcurrentAppendThread(tid: ThreadID) { for i in 0..<100 { barrier() - if tid == .Master { + if tid == .Leader { // Get a fresh buffer. sharedString = "" sharedString.appendContentsOf("abc") @@ -57,7 +57,7 @@ func sliceConcurrentAppendThread(tid: ThreadID) { barrier() // Append to the private string. - if tid == .Master { + if tid == .Leader { privateString.appendContentsOf("def") } else { privateString.appendContentsOf("ghi") @@ -74,14 +74,14 @@ func sliceConcurrentAppendThread(tid: ThreadID) { expectEqual("abc", sharedString) // Verify that only one thread took ownership of the buffer. - if tid == .Slave { - slaveString = privateString + if tid == .Follower { + followerString = privateString } barrier() - if tid == .Master { + if tid == .Leader { expectTrue( (privateString.bufferID == sharedString.bufferID) != - (slaveString.bufferID == sharedString.bufferID)) + (followerString.bufferID == sharedString.bufferID)) } } } @@ -93,9 +93,9 @@ StringTestSuite.test("SliceConcurrentAppend") { expectEqual(0, ret) let (createRet1, tid1) = _stdlib_pthread_create_block( - nil, sliceConcurrentAppendThread, .Master) + nil, sliceConcurrentAppendThread, .Leader) let (createRet2, tid2) = _stdlib_pthread_create_block( - nil, sliceConcurrentAppendThread, .Slave) + nil, sliceConcurrentAppendThread, .Follower) expectEqual(0, createRet1) expectEqual(0, createRet2)