SwiftPackageIndex-Server icon indicating copy to clipboard operation
SwiftPackageIndex-Server copied to clipboard

Consolidate locking mechanisms with stdlib Mutex

Open finestructure opened this issue 1 year ago • 4 comments

We're using three different locking mechanisms at the moment, ActorIsolated, LockIsolated, and QueueIsolated. We should use the new standard library Mutex instead.

finestructure avatar Nov 22 '24 10:11 finestructure

Have to be aware of some pitfalls here, Mutex can apparently crash the compiler on Linux.

https://github.com/swift-server/swift-aws-lambda-runtime/blob/eb634fa9abcd178f9f86852ea0839109bd949a97/Sources/AWSLambdaRuntime/LambdaRuntime.swift#L30

finestructure avatar Mar 14 '25 13:03 finestructure

See https://github.com/swiftlang/swift/issues/80036 and https://github.com/swiftlang/swift/issues/80020

finestructure avatar Mar 15 '25 09:03 finestructure

Looks like the compiler crash happens on Mutex with generic types only https://github.com/swiftlang/swift/issues/78048

sebsto avatar Mar 15 '25 09:03 sebsto

I also think https://github.com/swiftlang/swift/issues/80020 is not related to Mutex

sebsto avatar Mar 15 '25 09:03 sebsto