tac0S
Template Affectional Command Operating System
|
The following class defines a "synchronized list" – a list for which: these constraints hold: More...
#include <synchlist.h>
Public Member Functions | |
SynchList () | |
SynchList::SynchList Allocate and initialize the data structures needed for a synchronized list, empty to start with. Elements can now be added to the list. | |
~SynchList () | |
SynchList::~SynchList De-allocate the data structures created for synchronizing a list. | |
void | Append (void *item) |
SynchList::Append Append an "item" to the end of the list. Wake up anyone waiting for an element to be appended. More... | |
void * | Remove () |
SynchList::Remove Remove an "item" from the beginning of the list. Wait if the list is empty. Returns: More... | |
void | Mapcar (VoidFunctionPtr func) |
SynchList::Mapcar Apply function to every item on the list. Obey mutual exclusion constraints. More... | |
void * | get (unsigned int index) |
SynchList::get Get an object at the place "i". More... | |
unsigned int | size () |
SynchList::size Return the size of the current list. More... | |
void | GetTheLock () |
SynchList::GetTheLock Execute an acquire to the lock, then the kernel could use the list for thread management;. | |
void | FreeTheLock () |
SynchList::FreeTheLock Execute a release to the lock, then the kernel stop use the list for thread management;. | |
List * | getList () |
SynchList::getList Return the list, for thread management utilisation. More... | |
bool | IsEmpty () |
SynchList::IsEmpty Know if the synchlist is empty or not. More... | |
The following class defines a "synchronized list" – a list for which: these constraints hold:
void SynchList::Append | ( | void * | item | ) |
SynchList::Append Append an "item" to the end of the list. Wake up anyone waiting for an element to be appended.
void * SynchList::get | ( | unsigned int | index | ) |
SynchList::get Get an object at the place "i".
int index | : the place where it should be |
List * SynchList::getList | ( | ) |
SynchList::getList Return the list, for thread management utilisation.
bool SynchList::IsEmpty | ( | ) |
SynchList::IsEmpty Know if the synchlist is empty or not.
void SynchList::Mapcar | ( | VoidFunctionPtr | func | ) |
SynchList::Mapcar Apply function to every item on the list. Obey mutual exclusion constraints.
func | is the procedure to be applied. |
void * SynchList::Remove | ( | ) |
SynchList::Remove Remove an "item" from the beginning of the list. Wait if the list is empty. Returns:
unsigned int SynchList::size | ( | ) |
SynchList::size Return the size of the current list.