#include "sysnet.h"
#include "util.h"
#include "monsignals.h"
Go to the source code of this file.
Data Structures | |
| struct | aw_monthread_t |
Defines | |
| #define | AW_MONTHREAD_DESTROYLOCK(lock) sem_destroy( &(lock) ) |
| #define | AW_MONTHREAD_DOLOCK(lock) { while (unlikely(sem_wait(lock))) { perror(__FUNCTION__); } } |
| #define | AW_MONTHREAD_INITLOCK(lock) sem_init( &(lock), 0, 1) |
| #define | AW_MONTHREAD_UNLOCK(lock) { while (unlikely(sem_post(lock))) { perror(__FUNCTION__); } } |
Typedefs | |
| typedef sem_t | aw_plock_t |
Functions | |
| void | aw_clear_notify_monthread (aw_monthread_t *t) |
| Unset notification. | |
| aw_monthread_t * | aw_create_monthread (int32_t stacksize, int32_t(*f)(void *arg), void *arg) |
Spawn a running monitor thread. Allocates stack, signal stack.
| |
| void | aw_destroy_monthread (aw_monthread_t *t) |
| Cleanup , free resources. | |
| void * | aw_globalptr_monthread (aw_monthread_t *t) |
| Return pointer visible in both thread and signal handler using signal stack. | |
| int32_t | aw_in_monthread (aw_monthread_t *t) |
| Return non-zero if currently executing in specified thread. | |
| void | aw_notify_monthread (aw_monthread_t *t) |
| Send notification to wake from sleep. | |
| int32_t | aw_test_wait_monthread (aw_monthread_t *t) |
| Return non-zero if thread will wait if aw_wait_monthread() is called. | |
| void | aw_wait_destroy_monthread (aw_monthread_t *t, time_t seconds) |
| Cleanup , free resources AFTER waiting for thread to exit OR max seconds. | |
| void | aw_wait_monthread (aw_monthread_t *t) |
| Wait for signal OR notificaiton from aw_wake_monthread. | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Unset notification. aw_clear_notify_monthread
|
|
||||||||||||||||
|
Spawn a running monitor thread. Allocates stack, signal stack.
aw_create_monthread |
|
|
Cleanup , free resources. aw_destroy_monthread
|
|
|
Return pointer visible in both thread and signal handler using signal stack. aw_globalptr_monthread
|
|
|
Return non-zero if currently executing in specified thread. aw_in_monthread
|
|
|
Send notification to wake from sleep. aw_notify_monthread
|
|
|
Return non-zero if thread will wait if aw_wait_monthread() is called. aw_test_wait_monthread
|
|
||||||||||||
|
Cleanup , free resources AFTER waiting for thread to exit OR max seconds. aw_wait_destroy_monthread
|
|
|
Wait for signal OR notificaiton from aw_wake_monthread. aw_wait_monthread
|