Inherits ost::Thread, and ost::Mutex.
|
int | getCount (void) const |
| Get current reference count. More...
|
|
| SerialService (int pri=0, size_t stack=0, const char *id=((void *) 0)) |
| Create a service thread for attaching serial ports. More...
|
|
void | update (uint8_t flag=0xff) |
| Notify service thread that a port has been added or removed, or a timer changed, so that a new schedule can be computed for expiring attached ports. More...
|
|
virtual | ~SerialService () |
| Terminate the service thread and update attached objects.
|
|
void | detach (void) |
|
void | exit (void) |
|
virtual void | final (void) |
|
void | finalize (void) |
|
pthread_t | getId (void) const |
| Get the thread id.
|
|
virtual void | initial (void) |
|
bool | isRunning (void) |
|
bool | isThread (void) |
|
void | join (void) |
|
void | map (void) |
|
virtual void | notify (Thread *thread) |
|
virtual void | run (void)=0 |
|
void | start (void) |
|
void | sync (void) |
|
void | terminate (void) |
|
| Thread (int pri=0, size_t stack=0) |
|
|
virtual void | onCallback (SerialPort *port) |
| A virtual handler for adding support for additional callback events into SerialPort. More...
|
|
virtual void | onEvent (void) |
| A virtual handler for event loop calls. More...
|
|
virtual void | onUpdate (uint8_t flag) |
| A virtual handler for processing user defined update requests (1-254) which have been posted through Update. More...
|
|
bool | is_active (void) const |
| Check if running.
|
|
void | join (void) |
| Join thread with parent. More...
|
|
| JoinableThread (size_t size=0) |
| Create a joinable thread with a known context stack size. More...
|
|
virtual | ~JoinableThread () |
| Delete child thread. More...
|
|
void | background (void) |
| Start execution of child context as background thread. More...
|
|
void | start (int priority=0) |
| Start execution of child context. More...
|
|
void | map (void) |
| Map thread for get method. More...
|
|
| Thread (size_t stack=0) |
| Create a thread object that will have a preset stack size. More...
|
|
virtual void | exit (void) |
| Exit the thread context. More...
|
|
bool | isRunning (void) const |
|
| operator bool () const |
|
bool | operator! () const |
|
void | setPriority (void) |
| Set thread priority without disrupting scheduling if possible. More...
|
|
virtual | ~Thread () |
| Destroy thread object, thread-specific data, and execution context.
|
|
|
enum | Throw { throwNothing,
throwObject,
throwException
} |
| How to raise error.
|
|
typedef enum ost::Thread::Throw | Throw |
| How to raise error.
|
|
static Thread * | get (void) |
|
static Throw | getException (void) |
| Get exception mode of the current thread. More...
|
|
static void | setException (Throw mode) |
| Set exception mode of the current thread. More...
|
|
static void | sleep (timeout_t msec=ucommon::Timer::inf) |
|
static void | yield (void) |
|
enum | { R_UNUSED
} |
|
static size_t | cache (void) |
| Get cache line size.
|
|
static void | concurrency (int level) |
| Set concurrency level of process. More...
|
|
static bool | equal (pthread_t thread1, pthread_t thread2) |
| Determine if two thread identifiers refer to the same thread. More...
|
|
static Thread * | get (void) |
| Get mapped thread object. More...
|
|
static void | init (void) |
| Used to initialize threading library. More...
|
|
static void | policy (int polid) |
| Used to specify scheduling policy for threads above priority "0". More...
|
|
static void | release (void) |
|
static pthread_t | self (void) |
| Get current thread id. More...
|
|
static void | sleep (timeout_t timeout) |
| Sleep current thread for a specified time period. More...
|
|
static void | yield (void) |
| Yield execution context of the current thread. More...
|
|
volatile bool | joining |
|
volatile bool | running |
|
void * | cancellor |
|
int | priority |
|
enum ucommon::Thread:: { ... } | reserved |
|
stacksize_t | stack |
|
pthread_t | tid |
|
The SerialService is a thead service object that is meant to service attached serial ports.
Multiple pool objects may be created and multiple serial ports may be attached to the same thread of of execution. This allows one to balance threads and the serial ports they service.
The TTYPort and TTYService classes are used to form thread-pool serviced serial I/O protocol sets. These can be used when one has a large number of serial devices to manage, and a single (or limited number of) thread(s) can then be used to service the tty port objects present. Each tty port supports a timer control and several virtual methods that the service thread can call when events occur. This model provides for "callback" event management, whereby the service thread performs a "callback" into the port object when events occur. Specific events supported include the expiration of a TTYPort timer, pending input data waiting to be read, and "sighup" connection breaks.
- Author
- David Sugar dyfet.nosp@m.@ost.nosp@m.el.co.nosp@m.m Thread pool service for serial ports.
Definition at line 785 of file serial.h.