Is there a way to tell at runtime if a struct field is atomic?

When one makes a struct like

mutable struct Status
    @atomic st::Symbol
    # other fields
end

Is there a way to tell that st is a special field? Since fieldtypes gives no additional information.

julia> fieldtypes(Status)
(Symbol,)

Should there be an isatomic function?

You can use Base.isfieldatomic, it tells you exactly that:

julia> Base.isfieldatomic(Status, :st)
true

Is this documented anywhere?

It’s mentioned here:

should arguably be public.

Ooh, I didn’t know about this. It will be coming to the next About.jl version.