Struct semaphore::Semaphore [] [src]

pub struct Semaphore { /* fields omitted */ }

An atomic counter which can be shared across processes.

Methods

impl Semaphore
[src]

[src]

Create a new semaphore with the given limit.

[src]

Attempt to access a resource of this semaphore.

This function will first acquire a resource and then return an RAII guard structure which will release the resource when it falls out of scope.

If the semaphore is at limit, None will be returned.

[src]

Block until the resource is not being accessed anymore.

This can be used to determine whether it is safe to free or shutdown the resource.

Trait Implementations

impl Clone for Semaphore
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more