 
 enum ThreadID {
   case Primary
-  case Replica
+  case Secondary
 }
 
 var barrierVar: UnsafeMutablePointer<_stdlib_pthread_barrier_t> = nil
 var sharedString: String = ""
-var replicaString: String = ""
+var secondaryString: String = ""
 
 func barrier() {
   var ret = _stdlib_pthread_barrier_wait(barrierVar)

    expectEqual("abc", sharedString)

    // Verify that only one thread took ownership of the buffer.
    if tid == .Replica {
      replicaString = privateString
    }
    barrier()
    if tid == .Primary {
      expectTrue(
        (privateString.bufferID == sharedString.bufferID) !=
          (replicaString.bufferID == sharedString.bufferID))
    }
  }
}

  let (createRet1, tid1) = _stdlib_pthread_create_block(
    nil, sliceConcurrentAppendThread, .Primary)
  let (createRet2, tid2) = _stdlib_pthread_create_block(
    nil, sliceConcurrentAppendThread, .Secondary)

  expectEqual(0, createRet1)
  expectEqual(0, createRet2)
