libtools
mailbox.h
Go to the documentation of this file.
1 
20 #ifndef __TOOLS_MAILBOX_H
21 #define __TOOLS_MAILBOX_H
22 
30 typedef struct mailbox *mailbox_t;
31 
41 mailbox_t mailbox_alloc(mailbox_t *mb, unsigned len)
42  __attribute__((warn_unused_result));
43 
50 void mailbox_destroy(mailbox_t mb);
51 
61 int mailbox_post(mailbox_t mb, void *data);
71 int mailbox_wait(mailbox_t mb, void **data);
72 
84 int mailbox_timedwait(mailbox_t mb, void **data, unsigned timeout);
85 
88 #endif /* __TOOLS_MAILBOX_H */
struct mailbox * mailbox_t
mailbox handle
Definition: mailbox.h:30
void mailbox_destroy(mailbox_t mb)
destroy mailbox
mailbox_t mailbox_alloc(mailbox_t *mb, unsigned len) __attribute__((warn_unused_result))
allocate new mailbox
int mailbox_timedwait(mailbox_t mb, void **data, unsigned timeout)
retrive message from mailbox with or wait for message
int mailbox_wait(mailbox_t mb, void **data)
retrive message from mailbox
int mailbox_post(mailbox_t mb, void *data)
post message into mailbox