Make select timeout user configurable for native platform
This commit is contained in:
parent
be4535c49e
commit
ca16bf1bd2
|
@ -76,6 +76,12 @@
|
||||||
#define SELECT_MAX 8
|
#define SELECT_MAX 8
|
||||||
#endif
|
#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 const struct select_callback *select_callback[SELECT_MAX];
|
||||||
static int select_max = 0;
|
static int select_max = 0;
|
||||||
|
|
||||||
|
@ -252,7 +258,7 @@ platform_main_loop()
|
||||||
retval = process_run();
|
retval = process_run();
|
||||||
|
|
||||||
tv.tv_sec = 0;
|
tv.tv_sec = 0;
|
||||||
tv.tv_usec = retval ? 1 : 1000;
|
tv.tv_usec = retval ? 1 : SELECT_TIMEOUT;
|
||||||
|
|
||||||
FD_ZERO(&fdr);
|
FD_ZERO(&fdr);
|
||||||
FD_ZERO(&fdw);
|
FD_ZERO(&fdw);
|
||||||
|
|
Loading…
Reference in New Issue