We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When running the below concurrently in a multi-thread situation, the below functions sometimes hit thread-safe exception.
Thread 2: EXC_BAD_ACCESS (code=1, address=0xfffffffffffffff0)
private let executionQueue = DispatchQueue(label: "com.swiftmath.concurrencytests", attributes: .concurrent) private let executionGroup = DispatchGroup() let totalCases = 20 var testCount = 0 func testSwiftMathConcurrentScript() throws { for caseNumber in 0 ..< totalCases { helperConcurrency(caseNumber, in: executionGroup, on: executionQueue) { let result1 = getInterElementSpaces() let result2 = MTMathAtomFactory.delimValueToName let result3 = MTMathAtomFactory.accentValueToName let result4 = MTMathAtomFactory.textToLatexSymbolName XCTAssertNotNil(result1) XCTAssertNotNil(result2) XCTAssertNotNil(result3) XCTAssertNotNil(result4) } } executionGroup.notify(queue: .main) { [weak self] in // print("All test cases completed: \(self?.testCount ?? 0)") } executionGroup.wait() } func helperConcurrency(_ count: Int, in group: DispatchGroup, on queue: DispatchQueue, _ testClosure: @escaping () -> (Void)) { let workitem = DispatchWorkItem { testClosure() } workitem.notify(queue: .main) { [weak self] in self?.testCount += 1 } queue.async(group: group, execute: workitem) }
At the moment the below static function is not invoked by any code, however, if in-use, will also cause thread-safety exception.
public static func add(latexSymbol name: String, value: MTMathAtom) { supportedLatexSymbols[name] = value Self.textToLatexSymbolName[value.nucleus] = name }
The text was updated successfully, but these errors were encountered:
issued a push request.
Sorry, something went wrong.
Incorporated. Thanks for the fix.
No branches or pull requests
Description of the Exception
When running the below concurrently in a multi-thread situation, the below functions sometimes hit thread-safe exception.
Thread 2: EXC_BAD_ACCESS (code=1, address=0xfffffffffffffff0)
Test code run repeatedly
Further investigations
At the moment the below static function is not invoked by any code, however, if in-use, will also cause thread-safety exception.
The text was updated successfully, but these errors were encountered: