#include <synchlist.h>
Public Methods | |
| SynchList () | |
| initialize a synchronized list. More... | |
| ~SynchList () | |
| de-allocate a synchronized list. More... | |
| void | Append (T item) |
| append item to the end of the list, and wake up any thread waiting in remove. More... | |
| T | RemoveFront () |
| remove the first item from the front of the list, waiting if the list is empty. More... | |
| void | Apply (void(*f)(T)) |
| apply function to all elements in list. More... | |
| void | SelfTest (T value) |
| test the SynchList implementation. More... | |
Private Methods | |
| void | SelfTestHelper () |
| only to assist SelfTest(). More... | |
Private Attributes | |
| List<T>* | list |
| the list of things. More... | |
| Lock* | lock |
| enforce mutual exclusive access to the list. More... | |
| Condition* | listEmpty |
| wait in Remove if the list is empty. More... | |
| SynchList<T>* | selfTestPing |
| only to assist SelfTest(). More... | |
Definition at line 24 of file synchlist.h.
|
||||
|
initialize a synchronized list. SynchList<T>::SynchList Allocate and initialize the data structures needed for a synchronized list, empty to start with. Elements can now be added to the list. Definition at line 23 of file synchlist.cc. |
|
||||
|
de-allocate a synchronized list. SynchList<T>~SynchList De-allocate the data structures created for synchronizing a list. Definition at line 36 of file synchlist.cc. |
|
||||
|
append item to the end of the list, and wake up any thread waiting in remove. SynchList<T>::Append Append an "item" to the end of the list. Wake up anyone waiting for an element to be appended. "item" is the thing to put on the list. Definition at line 53 of file synchlist.cc. Referenced by MailBox::Put(), SelfTest(), and SelfTestHelper().
|
|
||||
|
apply function to all elements in list. SynchList<T>::Apply Apply function to every item on a list. "func" -- the function to apply Definition at line 92 of file synchlist.cc. |
|
||||
|
remove the first item from the front of the list, waiting if the list is empty. SynchList<T>::RemoveFront Remove an "item" from the beginning of the list. Wait if the list is empty. Returns: The removed item. Definition at line 71 of file synchlist.cc. Referenced by MailBox::Get(), and SelfTestHelper().
|
|
||||
|
test the SynchList implementation.
Definition at line 117 of file synchlist.cc. Referenced by ThreadedKernel::SelfTest().
|
|
||||
|
only to assist SelfTest(). SynchList<T>::SelfTest, SelfTestHelper Test whether the SynchList implementation is working, by having two threads ping-pong a value between them using two synchronized lists. Definition at line 108 of file synchlist.cc. |
|
|||
|
the list of things.
Definition at line 40 of file synchlist.h. |
|
|||
|
wait in Remove if the list is empty.
Definition at line 42 of file synchlist.h. |
|
|||
|
enforce mutual exclusive access to the list.
Definition at line 41 of file synchlist.h. |
|
|||
|
only to assist SelfTest().
Definition at line 45 of file synchlist.h. |
1.2.8.1 written by Dimitri van Heesch,
© 1997-2001