Skip to content

Draft: [RFC] [posix.vapi] Add Atomics to posix.

Gustav Hartvigsson requested to merge gustav.hartvigsson/vala:atomics into main

There needs discussion if there needs to be a separate type for each atomic type. (Those starting with _Atomic in C).

This code is not compatible with the the one in the GLib namespace, and it is a question if it even needs to be.

I propose that each type gets a special type in the namespace Posix.[a,A]tomic:

Each type gets it's own type in the Posix namespace, named Atomic[Int,Long,...].

Since the C code uses generic macros it will just be a matter of copying the code form one type to an other. (I Think...)

Done:

Added the most relevent Atomic types.

Todo:

Add the rest of the Thread stuff:

  • Condition,
  • Mutex,
  • ThreadLocalStorage ThreadSpecificStorage,
  • call_once.

Comment:

Should this go into it's own vapi file?

(See: Reference)

Edited by Gustav Hartvigsson

Merge request reports

Loading