#include <misc.h>
Public Member Functions | |
Runlist (unsigned count=1) | |
Create a new runlist with a specified limit. | |
bool | add (Runable *run) |
Add a runable object to this runlist. | |
void | del (Runable *run) |
Remove a runable object from the wait list or notify when it is done running so that the used count can be decremented. | |
void | set (unsigned limit) |
Set the limit. | |
Protected Member Functions | |
void | check (void) |
Protected Attributes | |
unsigned | limit |
unsigned | used |
However, the runlist differs in that it notifies objects when they become ready to run, rather than requiring them to wait and "block" for the semaphore count to become low enough to continue.
ost::Runlist::Runlist | ( | unsigned | count = 1 |
) |
Create a new runlist with a specified limit.
count | limit before wait queuing. |
void ost::Runlist::check | ( | void | ) | [protected] |
bool ost::Runlist::add | ( | Runable * | run | ) |
Add a runable object to this runlist.
If the number of entries running is below the limit, then add returns true otherwise the entry is added to the list.
run | pointer to runable object. |
void ost::Runlist::del | ( | Runable * | run | ) |
Remove a runable object from the wait list or notify when it is done running so that the used count can be decremented.
run | pointer to runable object. |
void ost::Runlist::set | ( | unsigned | limit | ) |
Set the limit.
limit | to use. |
unsigned ost::Runlist::limit [protected] |
unsigned ost::Runlist::used [protected] |