Cannot find 'atomic_flag' in scope in Xcode 26

Hi,

In Xcode 16.4, the atomic_flag() method can be used, but in Xcode 26.0, it is not available. An error message saying Cannot find 'atomic_flag' in scope is displayed. This can be reproduced simply by trying to use atomic_flag() in a newly created empty project.

Thank you.

Xcode: Version 26.0 beta 4 (17A5285i), macOS: 15.5(24F74)

import SwiftUI

struct ContentView: View {
    var body: some View {
        VStack {
            Image(systemName: "globe")
                .imageScale(.large)
                .foregroundStyle(.tint)
            Text("Hello, world!")
        }
        .padding()
        .task {
            _ = atomic_flag()
        }
    }
}
Answered by erreewrwe in 852506022

@dazy_naoki , adding "import os" resolves issue for me

Accepted Answer

@dazy_naoki , adding "import os" resolves issue for me

Cannot find 'atomic_flag' in scope in Xcode 26
 
 
Q