diff options
| author | ruki <[email protected]> | 2020-01-14 23:37:17 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-01-14 15:43:44 +0800 |
| commit | 0666bf474275f6c0cc29b3f4a3934fbf7fafa810 (patch) | |
| tree | fe92c48a355ad00a399de0d3d24cd909622aa0cf /core/src | |
| parent | 79ff272c43033b52e85a7d742a132a6b15c33edb (diff) | |
improve process.waitlist
Diffstat (limited to 'core/src')
| -rw-r--r-- | core/src/xmake/process/waitlist.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/core/src/xmake/process/waitlist.c b/core/src/xmake/process/waitlist.c index 30d936f4d..8321f5c02 100644 --- a/core/src/xmake/process/waitlist.c +++ b/core/src/xmake/process/waitlist.c @@ -31,6 +31,13 @@ #include "prefix.h" /* ////////////////////////////////////////////////////////////////////////////////////// + * macros + */ + +// the max waited processes count at same time +#define XM_PROCESS_WAIT_MAXN (256) + +/* ////////////////////////////////////////////////////////////////////////////////////// * implementation */ @@ -64,7 +71,7 @@ tb_int_t xm_process_waitlist(lua_State* lua) // get the processes count tb_long_t count = lua_objlen(lua, 1); - if (count <= 0 || count > 64) + if (count <= 0 || count > XM_PROCESS_WAIT_MAXN) { // error lua_pushfstring(lua, "invalid process count(%d) for process.waitlist", count); @@ -74,7 +81,7 @@ tb_int_t xm_process_waitlist(lua_State* lua) // get the processes tb_int_t i = 0; - tb_process_ref_t processes[64 + 1]; + tb_process_ref_t processes[XM_PROCESS_WAIT_MAXN + 1]; for (i = 0; i < count; i++) { // get proclist[i] @@ -111,7 +118,7 @@ tb_int_t xm_process_waitlist(lua_State* lua) tb_long_t timeout = (tb_long_t)luaL_checkinteger(lua, 2); // wait it - tb_process_waitinfo_t infolist[64]; + tb_process_waitinfo_t infolist[XM_PROCESS_WAIT_MAXN]; tb_long_t infosize = tb_process_waitlist(processes, infolist, tb_arrayn(infolist), timeout); // save process info count |
