diff options
Diffstat (limited to 'src/ivyloop.h')
-rw-r--r-- | src/ivyloop.h | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/src/ivyloop.h b/src/ivyloop.h index 1d0b623..f272212 100644 --- a/src/ivyloop.h +++ b/src/ivyloop.h @@ -6,8 +6,8 @@ * * Main loop handling around select * - * Authors: François-Régis Colin <fcolin@cena.fr> - * Stéphane Chatty <chatty@cena.fr> + * Authors: François-Régis Colin <fcolin@cena.dgac.fr> + * Stéphane Chatty <chatty@cena.dgac.fr> * * $Id$ * @@ -25,10 +25,39 @@ extern "C" { #include "ivychannel.h" +/* general Handle */ -extern void IvyMainLoop(void(*hook)(void) ); -extern void IvyIdle(); +#define ANYPORT 0 +#ifdef WIN32 +#include <windows.h> +#define HANDLE SOCKET +#else +#define HANDLE int +#endif + +/* +Boucle principale d'IVY baseé sur un select +les fonctions hook et unhook encradre le select +de la maniere suivante: + + BeforeSelect est appeler avant l'appel system select + AfterSelect est appeler avent l'appel system select + ces function peuvent utilisées pour depose un verrou dans le cas + d'utilisation de la mainloop Ivy dans une thread separe + + BeforeSelect ==> on libere l'acces avant la mise en attente sur le select + AfterSelect == > on verrouille l'acces en sortie du select + + !!!! Attention donc l'appel des callbacks ivy se fait avec l'acces verrouille ! +*/ + +extern void IvyMainLoop(void); + +typedef void ( *IvyHookPtr) ( void *data ); + +extern void IvySetBeforeSelectHook(IvyHookPtr before, void *data ); +extern void IvySetAfterSelectHook(IvyHookPtr after, void *data ); #ifdef __cplusplus } |