Accès simultané à 0x1c0a7f0f8, mais la modification nécessite un accès exclusif d'erreur sur Xcode 9 beta 4

mon projet utilise à la fois Objective-C et Swift code. Lorsqu'un utilisateur se connecte, il appelle un ensemble d'api pour la préférence de l'utilisateur, j'ai un DataCoordinator.swift classe où les horaires le fonctionnement de l'API et je en faire des appels à partir de UserDetailViewController.m classe de charger les préférences de l'utilisateur. Cette utilisation pour le travail bien avant que j'ai migré mon code Swift 4 à l'aide de Xcode 9 beta 4. Maintenant, quand je me connecte il se bloque en me donnant cette erreur dans mon DataCoordinator classe. Ci-dessous est un échantillon de mes DataCoordinator et Viewcontroller classe.

DataCoordinator.swift
import UIKit
@objcMembers
class DataCoordinator: NSObject {
//MARK:- Private
    fileprivate var user = myDataStore.sharedInstance().user
fileprivate var preferenceFetchOperations = [FetchOperation]()
fileprivate func scheduleFetchOperation(_ operation:FetchOperation, inFetchOperations operations:inout [FetchOperation]) {
guard  operations.index(of: operation) == nil else { return }
operations.append(operation)
}
fileprivate func completeFetchOperation(_ fetchOperation:FetchOperation, withError error:Error?, andCompletionHandler handler:@escaping FetchCompletionHandler) {
func removeOperation(_ operation:FetchOperation, fromOperations operations:inout [FetchOperation]) {
if operations.count > 0 {
operations.remove(at: operations.index(of: fetchOperation)!)                 
handler(error)
}
}
if preferenceFetchOperations.contains(fetchOperation) {
removeOperation(fetchOperation, fromOperations: &preferenceFetchOperations)
}
}
fileprivate func schedulePreferencesFetchOperation(_ serviceName:String, fetch:@escaping FetchOperationBlock){
let operation = FetchOperation(name: serviceName, fetch: fetch);
scheduleFetchOperation(operation, inFetchOperations: &preferenceFetchOperations)
}
fileprivate func runOperationsIn(_ fetchOperations:inout [FetchOperation]) {
for  var operation in fetchOperations {
guard operation.isActivated == false else { continue }
operation.isActivated = true
operation.execute()
}
}
//MARK:- Non-Private
    typealias FetchCompletionHandler = (_ error:Error?)->Void
var numberOfPreferencesFetchCalls:Int {
get { return preferenceFetchOperations.count }
}
//MARK: -
    func fetchPreferences(_ completionHandler:@escaping FetchCompletionHandler) -> Void {
defer {
runOperationsIn(&preferenceFetchOperations)
}
schedulePreferencesFetchOperation("com.fetchPreferences.type1") {[unowned self] (operation:FetchOperation) in
WebServiceManager.getType1Detail(for: user) {[unowned self] (error) in
self.completeFetchOperation(operation,  withError: error, andCompletionHandler: completionHandler)
}
}
schedulePreferencesFetchOperation("com.fetchPreferences.type2") {[unowned self] (operation:FetchOperation) in
WebServiceManager.getType2Detail(for: user) {[unowned self] (error) in
self.completeFetchOperation(operation,  withError: error, andCompletionHandler: completionHandler)
}
}
schedulePreferencesFetchOperation("com.fetchPreferences.type3") {[unowned self] (operation:FetchOperation) in
WebServiceManager.getType3Detail(for: user) {[unowned self] (error) in
self.completeFetchOperation(operation,  withError: error, andCompletionHandler: completionHandler)
}
}
schedulePreferencesFetchOperation("com.fetchPreferences.type4") {[unowned self] (operation:FetchOperation) in
WebServiceManager.getType4Detail(for: user) {[unowned self] (error) in
self.completeFetchOperation(operation,  withError: error, andCompletionHandler: completionHandler)
}
}
}
}
//MARK:- Fetch Operation Struct
private typealias FetchOperationBlock = (_ operation:FetchOperation)->Void
private struct FetchOperation:Hashable {
fileprivate var runToken = 0
fileprivate let fetchBlock:FetchOperationBlock
let name:String!
var isActivated:Bool {
get {
return runToken == 0 ? false : true
}
mutating set {
if runToken == 0 && newValue == true {
runToken = 1
}
}
}
fileprivate var hashValue: Int {
get {
return name.hashValue
}
}
func execute() -> Void {
fetchBlock(self)
}
init (name:String, fetch:@escaping FetchOperationBlock) {
self.name = name
self.fetchBlock = fetch
}
}
private func ==(lhs: FetchOperation, rhs: FetchOperation) -> Bool {
return lhs.hashValue == rhs.hashValue
}

//C'est comme ça que j'appelle dans mon viewcontrollers méthode viewDidLoad

__weak UserDetailViewController *weakSelf = self;
[self.dataCoordinator fetchPreferences:^(NSError * _Nullable error) {
if (error == nil) {
[weakSelf didFetchPrefrences];
}
else {
//handle error
                }
}];
//completion response
- (void)didFetchPrefrences {
//when api calls complete load data
    if (self.dataCoordinator.numberOfPreferencesFetchCalls == 0) {
//Load details

}
}

Je ne suis pas sûr de la façon de procéder sur ce, j'ai vu un rapport de bug à https://bugs.swift.org/browse/SR-5119 mais il semble être fixe dans Xcode 9 beta 3. Toute aide est appréciée

Je vais voir ce que bien sur Xcode 9 beta 5. Pas une question de pré-bêta 4 ou Xcode 8. Encore creuser.
Passe encore pour moi dans Xcode 9 Beta 6 🙁 il arrive quand un ajouter un observateur à un MPVolumeViews bouton alpha chemin d'accès clé et se bloque lors de l'accès au contexte dans observeValue(forKeyPath:de:changement:objet:)
Savez-vous à quelle ligne de ce moment de l'exécution est déclenchée? Quel est l'objet à l'adresse 0x1c0a7f0f8?
Est-ce qui se passe dans le GM??
il semble déclencher @ line get { return preferenceFetchOperations.count }

OriginalL'auteur Gamerlegend | 2017-07-31