That PROCESS_EXITHANDLER() thing was after all kind of overengineered...

This commit is contained in:
oliverschmidt 2007-05-23 22:13:29 +00:00
parent a300c31d7e
commit 1629c207b5
3 changed files with 11 additions and 24 deletions

View file

@ -28,7 +28,7 @@
*
* This file is part of the Contiki operating system.
*
* @(#)$Id: tapdev-drv.c,v 1.1 2007/05/20 21:32:24 oliverschmidt Exp $
* @(#)$Id: tapdev-drv.c,v 1.2 2007/05/23 22:13:29 oliverschmidt Exp $
*/
#include "contiki-net.h"
@ -77,12 +77,6 @@ pollhandler(void)
}
}
/*---------------------------------------------------------------------------*/
static void
exithandler(void)
{
tapdev_exit();
}
/*---------------------------------------------------------------------------*/
PROCESS_THREAD(tapdev_process, ev, data)
{
PROCESS_POLLHANDLER(pollhandler());
@ -98,6 +92,8 @@ PROCESS_THREAD(tapdev_process, ev, data)
PROCESS_WAIT_UNTIL(ev == PROCESS_EVENT_EXIT);
tapdev_exit();
PROCESS_END();
}
/*---------------------------------------------------------------------------*/

View file

@ -28,7 +28,7 @@
*
* This file is part of the Contiki operating system.
*
* @(#)$Id: wpcap-drv.c,v 1.1 2007/05/20 21:32:24 oliverschmidt Exp $
* @(#)$Id: wpcap-drv.c,v 1.2 2007/05/23 22:13:29 oliverschmidt Exp $
*/
#include "contiki-net.h"
@ -79,16 +79,9 @@ pollhandler(void)
}
}
/*---------------------------------------------------------------------------*/
static void
exithandler(void)
{
wpcap_exit();
}
/*---------------------------------------------------------------------------*/
PROCESS_THREAD(wpcap_process, ev, data)
{
PROCESS_POLLHANDLER(pollhandler());
PROCESS_EXITHANDLER(exithandler());
PROCESS_BEGIN();
@ -100,6 +93,8 @@ PROCESS_THREAD(wpcap_process, ev, data)
PROCESS_WAIT_UNTIL(ev == PROCESS_EVENT_EXIT);
wpcap_exit();
PROCESS_END();
}
/*---------------------------------------------------------------------------*/

View file

@ -80,15 +80,6 @@ pollhandler(void)
process_poll(&example_packet_driver_process);
}
/*---------------------------------------------------------------------------*/
/*
* Here we shutdown the hardware in case the process exits.
*/
static void
exithandler(void)
{
shutdown_the_hardware();
}
/*---------------------------------------------------------------------------*/
/*
* Finally, we define the process that does the work.
*/
@ -135,6 +126,11 @@ PROCESS_THREAD(example_packet_driver_process, ev, data)
*/
PROCESS_WAIT_EVENT_UNTIL(ev == PROCESS_EVENT_EXIT);
/*
* Now we shutdown the hardware.
*/
shutdown_the_hardware();
/*
* Here ends the process.
*/