Update some API docs for Nonblocking.Lock and subclasses.
This commit is contained in:
parent
912582d957
commit
f1fdfd9f2c
2 changed files with 26 additions and 1 deletions
|
|
@ -16,7 +16,8 @@
|
|||
* pass. Another asynchronous task may call {@link notify} to mark the
|
||||
* lock as being safe, notifying waiting tasks. Once marked as being
|
||||
* safe to pass, a lock may be reset to being unsafe by calling {@link
|
||||
* reset}.
|
||||
* reset}. The lock cannot be passed initially, if this is desired
|
||||
* call notify after constructing it.
|
||||
*
|
||||
* See the specialised sub-classes for concrete implementations,
|
||||
* which vary based on two features:
|
||||
|
|
@ -84,6 +85,9 @@ public abstract class Geary.Nonblocking.Lock : BaseObject {
|
|||
private bool passed = false;
|
||||
private Gee.List<Pending> pending_queue = new Gee.LinkedList<Pending>();
|
||||
|
||||
/**
|
||||
* Constructs a new lock that is initially not able to be passed.
|
||||
*/
|
||||
protected Lock(bool broadcast, bool autoreset, Cancellable? cancellable = null) {
|
||||
this.broadcast = broadcast;
|
||||
this.autoreset = autoreset;
|
||||
|
|
|
|||
|
|
@ -19,9 +19,16 @@
|
|||
* @see Lock
|
||||
*/
|
||||
public class Geary.Nonblocking.Semaphore : Geary.Nonblocking.Lock {
|
||||
|
||||
/**
|
||||
* Constructs a new semaphore lock.
|
||||
*
|
||||
* The new lock is initially not able to be passed.
|
||||
*/
|
||||
public Semaphore(Cancellable? cancellable = null) {
|
||||
base (true, false, cancellable);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -37,9 +44,16 @@ public class Geary.Nonblocking.Semaphore : Geary.Nonblocking.Lock {
|
|||
* @see Lock
|
||||
*/
|
||||
public class Geary.Nonblocking.Event : Geary.Nonblocking.Lock {
|
||||
|
||||
/**
|
||||
* Constructs a new event lock.
|
||||
*
|
||||
* The new lock is initially not able to be passed.
|
||||
*/
|
||||
public Event(Cancellable? cancellable = null) {
|
||||
base (true, true, cancellable);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -55,7 +69,14 @@ public class Geary.Nonblocking.Event : Geary.Nonblocking.Lock {
|
|||
* @see Lock
|
||||
*/
|
||||
public class Geary.Nonblocking.Spinlock : Geary.Nonblocking.Lock {
|
||||
|
||||
/**
|
||||
* Constructs a new spin lock.
|
||||
*
|
||||
* The new lock is initially not able to be passed.
|
||||
*/
|
||||
public Spinlock(Cancellable? cancellable = null) {
|
||||
base (false, true, cancellable);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue