2004 by Marc J. Rochkind. All rights reserved. Portions marked "Open Source" may be copied under license.

 

Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

c7/uem.c File Reference


Detailed Description

Unified Event Manager prototype [Sec. 5.18.2].

Definition in file uem.c.

Go to the source code of this file.

Functions

uem_reg * new_reg (void)
bool queue_event (struct uem_event *e)
bool dequeue_event (struct uem_reg *p)
void cleanup_handler (void *arg)
void free_svmsg (struct uem_event *e)
void * thread_svmsg (void *arg)
bool uem_register_svmsg (int mqid, size_t msgsize, void *data)
void free_svsem_reg (struct uem_reg *p)
void * thread_svsem (void *arg)
bool uem_register_svsem (int semid, struct sembuf *sops, size_t nsops, void *data)
void * thread_fdset (void *arg)
bool uem_register_fdset (int nfds, fd_set *fdset, enum UEM_TYPE type, void *data)
void * thread_signal (void *arg)
bool uem_register_signal (int signum, void *data)
void * thread_process (void *arg)
bool uem_register_process (pid_t pid, void *data)
void * thread_heartbeat (void *arg)
bool uem_register_heartbeat (long usecs, void *data)
uem_event * uem_wait (void)
void uem_free (struct uem_event *e)
bool uem_unregister (struct uem_event *e)
bool uem_bgn (void)
bool uem_end (void)

Variables

pthread_mutex_t uem_mtx = PTHREAD_MUTEX_INITIALIZER
pthread_cond_t uem_cond_event = PTHREAD_COND_INITIALIZER
uem_event * event_head


Function Documentation

void cleanup_handler void *  arg  )  [static]
 

Definition at line 102 of file uem.c.

References uem_free().

Referenced by thread_fdset(), thread_heartbeat(), thread_process(), thread_signal(), thread_svmsg(), and thread_svsem().

bool dequeue_event struct uem_reg p  )  [static]
 

Definition at line 76 of file uem.c.

References EC_CLEANUP_BGN, EC_CLEANUP_END, ec_rv, event_head, pthread_mutex_lock(), pthread_mutex_unlock(), uem_event::ue_next, uem_event::ue_reg, uem_free(), and uem_mtx.

Referenced by uem_unregister().

void free_svmsg struct uem_event e  )  [static]
 

Definition at line 108 of file uem.c.

References uem_event::ue_buf.

Referenced by uem_free().

void free_svsem_reg struct uem_reg p  )  [static]
 

Definition at line 155 of file uem.c.

Referenced by uem_unregister().

struct uem_reg* new_reg void   )  [static]
 

Definition at line 33 of file uem.c.

References EC_CLEANUP_BGN, EC_CLEANUP_END, ec_null, and new_reg().

Referenced by new_reg(), uem_register_fdset(), uem_register_heartbeat(), uem_register_process(), uem_register_signal(), uem_register_svmsg(), and uem_register_svsem().

bool queue_event struct uem_event e  )  [static]
 

Definition at line 47 of file uem.c.

References EC_CLEANUP_BGN, EC_CLEANUP_END, ec_rv, event_head, pthread_cond_signal(), pthread_mutex_lock(), pthread_mutex_unlock(), uem_event::ue_errno, uem_event::ue_next, uem_event::ue_reg, uem_cond_event, uem_free(), uem_mtx, and uem_reg::ur_type.

Referenced by thread_fdset(), thread_heartbeat(), thread_process(), thread_signal(), thread_svmsg(), and thread_svsem().

void* thread_fdset void *  arg  )  [static]
 

Definition at line 294 of file uem.c.

References cleanup_handler(), EC_CLEANUP_BGN, EC_CLEANUP_END, EC_FAIL, ec_false, EC_FLUSH, ec_null, ec_rv, errno, event_head, FD_ISSET(), pthread_cleanup_pop(), pthread_cleanup_push(), pthread_mutex_lock(), pthread_mutex_unlock(), queue_event(), select(), uem_event::ue_errno, uem_event::ue_next, uem_event::ue_reg, uem_event::ue_result, UEM_FD_ERROR, UEM_FD_READ, UEM_FD_WRITE, uem_free(), uem_mtx, uem_reg::ur_resource, uem_reg::ur_size, and uem_reg::ur_type.

Referenced by uem_register_fdset().

void* thread_heartbeat void *  arg  )  [static]
 

Definition at line 483 of file uem.c.

References cleanup_handler(), EC_CLEANUP_BGN, EC_CLEANUP_END, ec_false, EC_FLUSH, ec_neg1, ec_null, nanosleep(), pthread_cleanup_pop(), pthread_cleanup_push(), queue_event(), timespec::tv_nsec, timespec::tv_sec, uem_event::ue_reg, and uem_free().

Referenced by uem_register_heartbeat().

void* thread_process void *  arg  )  [static]
 

Definition at line 444 of file uem.c.

References cleanup_handler(), EC_CLEANUP_BGN, EC_CLEANUP_END, ec_false, EC_FLUSH, ec_null, errno, pthread_cleanup_pop(), pthread_cleanup_push(), queue_event(), uem_event::ue_errno, uem_event::ue_reg, uem_event::ue_result, uem_free(), uem_reg::ur_resource, and waitpid().

Referenced by uem_register_process().

void* thread_signal void *  arg  )  [static]
 

Definition at line 388 of file uem.c.

References cleanup_handler(), EC_CLEANUP_BGN, EC_CLEANUP_END, ec_false, EC_FLUSH, ec_neg1, ec_null, pthread_cleanup_pop(), pthread_cleanup_push(), queue_event(), set(), sigaddset(), sigemptyset(), sigwait(), uem_event::ue_errno, uem_event::ue_reg, uem_event::ue_result, and uem_free().

Referenced by uem_register_signal().

void* thread_svmsg void *  arg  )  [static]
 

Definition at line 114 of file uem.c.

References cleanup_handler(), EC_CLEANUP_BGN, EC_CLEANUP_END, ec_false, EC_FLUSH, ec_null, errno, msgrcv(), pthread_cleanup_pop(), pthread_cleanup_push(), queue_event(), uem_event::ue_buf, uem_event::ue_errno, uem_event::ue_reg, uem_event::ue_result, uem_free(), uem_reg::ur_resource, and uem_reg::ur_size.

Referenced by uem_register_svmsg().

void* thread_svsem void *  arg  )  [static]
 

Definition at line 159 of file uem.c.

References cleanup_handler(), EC_CLEANUP_BGN, EC_CLEANUP_END, ec_false, EC_FLUSH, ec_null, errno, pthread_cleanup_pop(), pthread_cleanup_push(), queue_event(), semop(), uem_event::ue_errno, uem_event::ue_reg, uem_event::ue_result, uem_free(), uem_reg::ur_resource, and uem_reg::ur_size.

Referenced by uem_register_svsem().

bool uem_bgn void   ) 
 

Definition at line 610 of file uem.c.

References EC_CLEANUP_BGN, EC_CLEANUP_END, ec_neg1, ec_rv, pthread_sigmask(), set(), sigdelset(), sigemptyset(), and sigfillset().

Referenced by main().

bool uem_end void   ) 
 

Definition at line 625 of file uem.c.

Referenced by main().

void uem_free struct uem_event e  ) 
 

Definition at line 544 of file uem.c.

References free_svmsg(), uem_event::ue_reg, UEM_FD_ERROR, UEM_FD_READ, UEM_FD_WRITE, UEM_HEARTBEAT, UEM_NONE, UEM_PROCESS, UEM_PXMSG, UEM_PXSEM, UEM_SIG, UEM_SVMSG, UEM_SVSEM, and uem_reg::ur_type.

Referenced by cleanup_handler(), dequeue_event(), main(), queue_event(), thread_fdset(), thread_heartbeat(), thread_process(), thread_signal(), thread_svmsg(), and thread_svsem().

bool uem_register_fdset int  nfds,
fd_set *  fdset,
enum UEM_TYPE  type,
void *  data
 

Definition at line 362 of file uem.c.

References EC_CLEANUP_BGN, EC_CLEANUP_END, EC_FAIL, ec_null, ec_rv, errno, new_reg(), pthread_create(), thread_fdset(), UEM_FD_ERROR, UEM_FD_READ, UEM_FD_WRITE, uem_reg::ur_data, uem_reg::ur_resource, uem_reg::ur_size, uem_reg::ur_tid, and uem_reg::ur_type.

Referenced by setup_fdset().

bool uem_register_heartbeat long  usecs,
void *  data
 

Definition at line 509 of file uem.c.

References EC_CLEANUP_BGN, EC_CLEANUP_END, ec_null, ec_rv, new_reg(), pthread_create(), thread_heartbeat(), UEM_HEARTBEAT, uem_reg::ur_data, uem_reg::ur_resource, uem_reg::ur_size, uem_reg::ur_tid, and uem_reg::ur_type.

Referenced by main().

bool uem_register_process pid_t  pid,
void *  data
 

Definition at line 465 of file uem.c.

References EC_CLEANUP_BGN, EC_CLEANUP_END, ec_null, ec_rv, new_reg(), pthread_create(), thread_process(), UEM_PROCESS, uem_reg::ur_data, uem_reg::ur_resource, uem_reg::ur_size, uem_reg::ur_tid, and uem_reg::ur_type.

Referenced by setup_process().

bool uem_register_signal int  signum,
void *  data
 

Definition at line 416 of file uem.c.

References EC_CLEANUP_BGN, EC_CLEANUP_END, ec_neg1, ec_null, ec_rv, new_reg(), pthread_create(), pthread_sigmask(), set(), sigaddset(), sigemptyset(), thread_signal(), UEM_SIG, uem_reg::ur_data, uem_reg::ur_resource, uem_reg::ur_tid, and uem_reg::ur_type.

Referenced by setup_signal().

bool uem_register_svmsg int  mqid,
size_t  msgsize,
void *  data
 

Definition at line 138 of file uem.c.

References EC_CLEANUP_BGN, EC_CLEANUP_END, ec_null, ec_rv, new_reg(), pthread_create(), thread_svmsg(), UEM_SVMSG, uem_reg::ur_data, uem_reg::ur_resource, uem_reg::ur_size, uem_reg::ur_tid, and uem_reg::ur_type.

Referenced by setup_systemv_msg().

bool uem_register_svsem int  semid,
struct sembuf sops,
size_t  nsops,
void *  data
 

Definition at line 183 of file uem.c.

References EC_CLEANUP_BGN, EC_CLEANUP_END, ec_null, ec_rv, new_reg(), pthread_create(), thread_svsem(), UEM_SVSEM, uem_reg::ur_data, uem_reg::ur_resource, uem_reg::ur_size, uem_reg::ur_tid, and uem_reg::ur_type.

Referenced by setup_systemv_sem().

bool uem_unregister struct uem_event e  ) 
 

Definition at line 574 of file uem.c.

References dequeue_event(), EC_CLEANUP_BGN, EC_CLEANUP_END, ec_false, ec_rv, free_svsem_reg(), pthread_cancel(), uem_event::ue_reg, UEM_FD_ERROR, UEM_FD_READ, UEM_FD_WRITE, UEM_HEARTBEAT, UEM_NONE, UEM_PROCESS, UEM_PXMSG, UEM_PXSEM, UEM_SIG, UEM_SVMSG, UEM_SVSEM, uem_reg::ur_tid, and uem_reg::ur_type.

Referenced by main().

struct uem_event* uem_wait void   ) 
 

Definition at line 526 of file uem.c.

References EC_CLEANUP_BGN, EC_CLEANUP_END, ec_rv, event_head, pthread_cond_wait(), pthread_mutex_lock(), pthread_mutex_unlock(), uem_event::ue_next, uem_cond_event, uem_mtx, and uem_wait().

Referenced by main(), and uem_wait().


Variable Documentation

struct uem_event* event_head [static]
 

Definition at line 31 of file uem.c.

Referenced by dequeue_event(), queue_event(), thread_fdset(), and uem_wait().

pthread_cond_t uem_cond_event = PTHREAD_COND_INITIALIZER [static]
 

Definition at line 30 of file uem.c.

Referenced by queue_event(), and uem_wait().

pthread_mutex_t uem_mtx = PTHREAD_MUTEX_INITIALIZER [static]
 

Definition at line 29 of file uem.c.

Referenced by dequeue_event(), queue_event(), thread_fdset(), and uem_wait().


Generated on Fri Apr 23 10:57:10 2004 for AUP2 Example Source by doxygen 1.3.1