home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_08_12
/
8n12077a
< prev
next >
Wrap
Text File
|
1990-08-29
|
671b
|
25 lines
/* sender.c - Sender task for synchronous communication */
#define REPLY 0
static handler Reply(msg_t *msg_ptr) { /* for synchronization only */
}
task Sender(void) {
task_t self = task_self();
msg_t msg;
task_setHandler(1, Reply); /* this task has one handler called Reply */
loop {
/* interrupt Receiver and wait on Reply */
msg.srcTid = self;
msg.dstTid = task_idOf("Receiver");
msg.dstHid = 0; /* Sync = Handler Id #0 */
msg.type = msg_type_DATA;
msg.value.a = /* address of DATA */
task_interruptEnableWait(&msg, NO_TIMEOUT, 1, REPLY);
/* ... */
}
}