Make select timeout user configurable for native platform

This commit is contained in:
Laurent Deru 2017-12-07 16:20:53 +01:00
parent be4535c49e
commit ca16bf1bd2
1 changed files with 7 additions and 1 deletions

View File

@ -76,6 +76,12 @@
#define SELECT_MAX 8
#endif
#ifdef SELECT_CONF_TIMEOUT
#define SELECT_TIMEOUT SELECT_CONF_TIMEOUT
#else
#define SELECT_TIMEOUT 1000
#endif
static const struct select_callback *select_callback[SELECT_MAX];
static int select_max = 0;
@ -252,7 +258,7 @@ platform_main_loop()
retval = process_run();
tv.tv_sec = 0;
tv.tv_usec = retval ? 1 : 1000;
tv.tv_usec = retval ? 1 : SELECT_TIMEOUT;
FD_ZERO(&fdr);
FD_ZERO(&fdw);