Revert "unix,win: wait for threads to start"

Reverted for suspected regressions in the Node.js test suite on Windows.

Also revert e99ac4c1f4 ("test: add threadpool init/teardown test") since
it depends on 5486f6bd51.

This reverts commit 5486f6bd51.
This reverts commit e99ac4c1f4.

PR-URL: https://github.com/libuv/libuv/pull/1656
Refs: https://github.com/libuv/libuv/pull/1639
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
Ben Noordhuis 2017-11-30 00:09:42 +01:00
parent c845245e43
commit 49616e4e17
3 changed files with 4 additions and 27 deletions

View File

@ -38,6 +38,7 @@ static uv_thread_t* threads;
static uv_thread_t default_threads[4];
static QUEUE exit_message;
static QUEUE wq;
static volatile int initialized;
static void uv__cancelled(struct uv__work* w) {
@ -104,7 +105,7 @@ static void post(QUEUE* q) {
UV_DESTRUCTOR(static void cleanup(void)) {
unsigned int i;
if (nthreads == 0)
if (initialized == 0)
return;
post(&exit_message);
@ -121,6 +122,7 @@ UV_DESTRUCTOR(static void cleanup(void)) {
threads = NULL;
nthreads = 0;
initialized = 0;
}
#endif
@ -128,7 +130,6 @@ UV_DESTRUCTOR(static void cleanup(void)) {
static void init_threads(void) {
unsigned int i;
const char* val;
int spin;
nthreads = ARRAY_SIZE(default_threads);
val = getenv("UV_THREADPOOL_SIZE");
@ -160,11 +161,7 @@ static void init_threads(void) {
if (uv_thread_create(threads + i, worker, NULL))
abort();
do {
uv_mutex_lock(&mutex);
spin = (idle_threads < nthreads);
uv_mutex_unlock(&mutex);
} while (spin);
initialized = 1;
}

View File

@ -28,7 +28,6 @@ TEST_DECLARE (run_once)
TEST_DECLARE (run_nowait)
TEST_DECLARE (loop_alive)
TEST_DECLARE (loop_close)
TEST_DECLARE (loop_instant_close)
TEST_DECLARE (loop_stop)
TEST_DECLARE (loop_update_time)
TEST_DECLARE (loop_backend_timeout)
@ -423,7 +422,6 @@ TASK_LIST_START
TEST_ENTRY (run_nowait)
TEST_ENTRY (loop_alive)
TEST_ENTRY (loop_close)
TEST_ENTRY (loop_instant_close)
TEST_ENTRY (loop_stop)
TEST_ENTRY (loop_update_time)
TEST_ENTRY (loop_backend_timeout)

View File

@ -55,21 +55,3 @@ TEST_IMPL(loop_close) {
return 0;
}
static void loop_instant_close_work_cb(uv_work_t* req) {
}
static void loop_instant_close_after_work_cb(uv_work_t* req, int status) {
}
TEST_IMPL(loop_instant_close) {
static uv_loop_t loop;
static uv_work_t req;
ASSERT(0 == uv_loop_init(&loop));
ASSERT(0 == uv_queue_work(&loop,
&req,
loop_instant_close_work_cb,
loop_instant_close_after_work_cb));
MAKE_VALGRIND_HAPPY();
return 0;
}