style changes.

use suggested style for libuv.

Co-authored-by: Ben Noordhuis <info@bnoordhuis.nl>
This commit is contained in:
moe li 2025-09-14 23:39:08 +08:00 committed by GitHub
parent 7233af5c6e
commit 2a464e01fa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -194,24 +194,20 @@ void uv__threadpool_cleanup(void) {
static void init_threads(void) {
uv_thread_options_t config;
unsigned int i;
size_t bufsize;
char fastvarbuf[16];
size_t buflen;
char buf[16];
const char* val;
int err;
uv_sem_t sem;
nthreads = ARRAY_SIZE(default_threads);
bufsize = ARRAY_SIZE(fastvarbuf);
err = uv_os_getenv("UV_THREADPOOL_SIZE", fastvarbuf, &bufsize);
buflen = ARRAY_SIZE(buf);
err = uv_os_getenv("UV_THREADPOOL_SIZE", buf, &buflen);
val = NULL;
if (err == 0)
val = fastvarbuf;
else
val = NULL; /* UV_ENOBUFS, UV_ENOENT and other err */
val = buf;
if (val != NULL)
nthreads = atoi(val);