diff --git a/core/config.h b/core/config.h index 2c382d17..0d99d580 100644 --- a/core/config.h +++ b/core/config.h @@ -384,7 +384,7 @@ #define APP_THREAD_STACK_SIZE_DEFAULT (64 * 1024) #define APP_THREAD_STACK_SIZE_MIN (48 * 1024) #else -#define APP_THREAD_STACK_SIZE_DEFAULT (32 * 1024) +#define APP_THREAD_STACK_SIZE_DEFAULT (64 * 1024) #define APP_THREAD_STACK_SIZE_MIN (24 * 1024) #endif #endif /* end of !(defined(APP_THREAD_STACK_SIZE_DEFAULT) \ diff --git a/core/iwasm/libraries/lib-socket/test/nslookup.c b/core/iwasm/libraries/lib-socket/test/nslookup.c index 37150f1e..543a3fb2 100644 --- a/core/iwasm/libraries/lib-socket/test/nslookup.c +++ b/core/iwasm/libraries/lib-socket/test/nslookup.c @@ -5,6 +5,8 @@ #include #include +#include +#include #ifdef __wasi__ #include #include @@ -39,11 +41,27 @@ test_nslookup(int af) freeaddrinfo(res); } +void * +test_nslookup_mt(void *params) +{ + int *af = (int *)params; + test_nslookup(*af); +} + int main() { - test_nslookup(AF_INET); /* for ipv4 */ - test_nslookup(AF_INET6); /* for ipv6 */ + int afs[] = { AF_INET, AF_INET6 }; + + for (int i = 0; i < sizeof(afs) / sizeof(afs[0]); i++) { + pthread_t th; + + printf("Testing %d in main thread...\n", afs[i]); + test_nslookup(afs[i]); + printf("Testing %d in a new thread...\n", afs[i]); + pthread_create(&th, NULL, test_nslookup_mt, &afs[i]); + pthread_join(th, NULL); + } return 0; }