function pthread_barrier_init
(barrier : not null access pthread_barrier_t;
attr : System.Address := System.Null_Address;
- count : unsigned)
- return int;
+ count : unsigned) return int;
pragma Import (C, pthread_barrier_init, "pthread_barrier_init");
-- Initialize barrier with the attributes in attr. The barrier is opened
-- when count waiters arrived. If attr is null the default barrier
-- attributes shall be used.
- -- Destroy a previously dynamically initialized barrier
function pthread_barrier_destroy
(barrier : not null access pthread_barrier_t) return int;
pragma Import (C, pthread_barrier_destroy, "pthread_barrier_destroy");
overriding procedure Finalize (Barrier : in out Synchronous_Barrier) is
Result : int;
-
begin
Result := pthread_barrier_destroy (Barrier.POSIX_Barrier'Access);
pragma Assert (Result = 0);
overriding procedure Initialize (Barrier : in out Synchronous_Barrier) is
Result : int;
-
begin
Result := pthread_barrier_init
(barrier => Barrier.POSIX_Barrier'Access,
procedure Wait_For_Release
(The_Barrier : in out Synchronous_Barrier;
- Notified : out Boolean)
+ Notified : out Boolean)
is
Result : int;
Notified := (Result = PTHREAD_BARRIER_SERIAL_THREAD);
end Wait_For_Release;
+
end Ada.Synchronous_Barriers;