Semaphore


Object Hierarchy:

Object hierarchy for Semaphore

Description:

public class Semaphore : Object

Counting semaphore.

Semaphore controls concurrent access with permit counters. acquire() blocks when no permits are available; release() returns a permit.

Example:

    var created = Semaphore.of (3);
if (created.isError ()) {
return;
}
var sem = created.unwrap ();
sem.acquire ();
try {
// bounded concurrency section
} finally {
sem.release ();
}


Namespace: Vala.Concurrent
Package: Valacore

Content:

Static methods:

Methods:

Inherited Members:

All known members inherited from class GLib.Object