X hits on this document

PDF document

February 10, 2006 - page 231 / 238

935 views

0 shares

0 downloads

0 comments

231 / 238

#endif

/* An os-independent normal lock. */ typedef struct os_hnd_lock_s os_hnd_lock_t;

/* An os-independent read/write lock. */ typedef struct os_hnd_rwlock_s os_hnd_rwlock_t;

/* An os-independent condition variable. */ typedef struct os_hnd_cond_s os_hnd_cond_t;

/* An os-independent file descriptor holder. */ t y p e d e f s t r u c t o s _ h n d _ f d _ i d _ s o s _ h n d _ f d _ i d _ t ;

/* An os-independent timer. */ t y p e d e f s t r u c t o s _ h n d _ t i m e r _ i d _ s o s _ h n d _ t i m e r _ i d _ t ;

/*

This is a structure that defined the os-dependent stuff required by

threaded code. on success, or

In general, return values an errno value on failure.

of these should be zero The errno values will be

propigated back up to the commands that caused these to be if possible. */ t y p e d e f v o i d ( * o s _ d a t a _ r e a d y _ t ) ( i n t f d , v o i d * c b _ d a t a , o s _ h n d t y p e d e f v o i d ( * o s _ t i m e d _ o u t _ t ) ( v o i d * c b _ d a t a , o s _ h n d _ t i m e r _ i d

_ _

called,

fd_id_t t *id);

*id);

/*

T h i s c a n b e r e g i s t e r e d w i t h a d d _ f d _ t o _ w a i t _ f o r , i t w i l l b e c a l l e d

if the fd free race

handler is freed or replaced. conditions, handlers may be in

This can be used to avoid callbacks when you remove

t y p an fd to wait for, this will be called when all handlers done. */ e d e f v o i d ( * o s _ f d _ d a t a _ f r e e d _ t ) ( i n t f d , v o i d * d a t a ) ;

are

/ * T h i s c a n b e r e g i s t e r e d w i t h f r e e _ t i m e r , i t w i l l b e c a l l e d i f t h e

time free actually occurs.

This can be used to avoid free

conditions, handlers may be in callbacks when you free this will be called when all handlers are done. */ typedef void (*os_timer_freed_t)(void *data);

the

race timer,

typedef struct os_handler_s os_handler_t;

/* A function to output logs, used to override the default functions. */

t y p e d e f v o i d ( * o s _ v l o g _ t ) ( o s _ h a n d l e r _ const char t

*handler, *format,

e n u m i p m i _ l o g _ t y p e _ e l o g _ t y p e ,

va list

_

ap);

219

Document info
Document views935
Page views935
Page last viewedSun Dec 11 04:52:50 UTC 2016
Pages238
Paragraphs8090
Words85809

Comments