#include <mono/utils/mono-time.h>
#include <mono/utils/mono-rand.h>
#include <mono/utils/refcount.h>
+#include <mono/utils/w32api.h>
#define CPU_USAGE_LOW 80
#define CPU_USAGE_HIGH 95
/* unpark all worker->parked_threads */
mono_coop_cond_broadcast (&worker->parked_threads_cond);
+#if 0
for (;;) {
ThreadPoolWorkerCounter counter;
mono_coop_cond_wait (&worker->threads_exit_cond, &worker->threads_lock);
}
+#endif
mono_coop_mutex_unlock (&worker->threads_lock);
worker_thread (gpointer data)
{
MonoThreadPoolWorker *worker;
- MonoError error;
MonoInternalThread *thread;
ThreadPoolWorkerCounter counter;
g_ptr_array_add (worker->threads, thread);
mono_coop_mutex_unlock (&worker->threads_lock);
- mono_thread_set_name_internal (thread, mono_string_new (mono_get_root_domain (), "Threadpool worker"), FALSE, &error);
- mono_error_assert_ok (&error);
-
while (!mono_runtime_is_shutting_down ()) {
ThreadPoolWorkItem work_item;
mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_THREADPOOL, "[%p] worker finishing", mono_native_thread_id_get ());
mono_refcount_dec (worker);
+
+ return 0;
}
static gboolean
// printf ("monitor_thread: stop\n");
mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] monitor thread, finished", mono_native_thread_id_get ());
+
+ return 0;
}
static void