2009-06-18 14:48:07 +02:00
|
|
|
#ifndef _SPECIFIC_COMM_H_
|
|
|
|
#define _SPECIFIC_COMM_H_ 1
|
2009-06-10 09:58:50 +02:00
|
|
|
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
#define READ_IDX 0
|
|
|
|
#define WRITE_IDX 1
|
|
|
|
|
2009-06-18 14:48:07 +02:00
|
|
|
struct thread_comm
|
2009-06-10 09:58:50 +02:00
|
|
|
{
|
|
|
|
int *pipefd;
|
|
|
|
};
|
|
|
|
|
|
|
|
__BEGIN_DECLS
|
|
|
|
|
|
|
|
extern __thread int pipefd[];
|
2009-06-18 14:48:07 +02:00
|
|
|
extern struct thread_comm *tcomms;
|
2009-06-10 09:58:50 +02:00
|
|
|
|
2009-06-18 14:48:07 +02:00
|
|
|
void init_thread_comm(struct thread_comm *);
|
2009-06-16 13:22:08 +02:00
|
|
|
static inline void send(void **addr) {
|
2009-06-16 12:58:30 +02:00
|
|
|
write(pipefd[WRITE_IDX], &addr, sizeof(void *));
|
2009-06-10 09:58:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
__END_DECLS
|
|
|
|
|
|
|
|
#endif
|