|
Lines 235-241
Link Here
|
| 235 |
MonoDomain *domain; |
235 |
MonoDomain *domain; |
| 236 |
MonoThread *thread; |
236 |
MonoThread *thread; |
| 237 |
thread = mono_thread_current (); |
237 |
thread = mono_thread_current (); |
| 238 |
thread->threadpool_thread = TRUE; |
|
|
| 239 |
ves_icall_System_Threading_Thread_SetState (thread, ThreadState_Background); |
238 |
ves_icall_System_Threading_Thread_SetState (thread, ThreadState_Background); |
| 240 |
|
239 |
|
| 241 |
for (;;) { |
240 |
for (;;) { |
|
Lines 324-330
Link Here
|
| 324 |
InterlockedIncrement (&busy_io_worker_threads); |
323 |
InterlockedIncrement (&busy_io_worker_threads); |
| 325 |
InterlockedIncrement (&io_worker_threads); |
324 |
InterlockedIncrement (&io_worker_threads); |
| 326 |
domain = ((ares) ? ((MonoObject *) ares)->vtable->domain : mono_domain_get ()); |
325 |
domain = ((ares) ? ((MonoObject *) ares)->vtable->domain : mono_domain_get ()); |
| 327 |
mono_thread_create (mono_get_root_domain (), async_invoke_io_thread, ares); |
326 |
mono_thread_create_internal (mono_get_root_domain (), async_invoke_io_thread, ares, TRUE); |
| 328 |
} else { |
327 |
} else { |
| 329 |
append_job (&io_queue_lock, &async_io_queue, (MonoObject*)ares); |
328 |
append_job (&io_queue_lock, &async_io_queue, (MonoObject*)ares); |
| 330 |
ReleaseSemaphore (io_job_added, 1, NULL); |
329 |
ReleaseSemaphore (io_job_added, 1, NULL); |
|
Lines 396-402
Link Here
|
| 396 |
MonoThread *thread; |
395 |
MonoThread *thread; |
| 397 |
|
396 |
|
| 398 |
thread = mono_thread_current (); |
397 |
thread = mono_thread_current (); |
| 399 |
thread->threadpool_thread = TRUE; |
|
|
| 400 |
ves_icall_System_Threading_Thread_SetState (thread, ThreadState_Background); |
398 |
ves_icall_System_Threading_Thread_SetState (thread, ThreadState_Background); |
| 401 |
|
399 |
|
| 402 |
allocated = INITIAL_POLLFD_SIZE; |
400 |
allocated = INITIAL_POLLFD_SIZE; |
|
Lines 766-776
Link Here
|
| 766 |
g_assert (io_job_added != NULL); |
764 |
g_assert (io_job_added != NULL); |
| 767 |
InitializeCriticalSection (&io_queue_lock); |
765 |
InitializeCriticalSection (&io_queue_lock); |
| 768 |
if (data->epoll_disabled) { |
766 |
if (data->epoll_disabled) { |
| 769 |
mono_thread_create (mono_get_root_domain (), socket_io_poll_main, data); |
767 |
mono_thread_create_internal (mono_get_root_domain (), socket_io_poll_main, data, TRUE); |
| 770 |
} |
768 |
} |
| 771 |
#ifdef HAVE_EPOLL |
769 |
#ifdef HAVE_EPOLL |
| 772 |
else { |
770 |
else { |
| 773 |
mono_thread_create (mono_get_root_domain (), socket_io_epoll_main, data); |
771 |
mono_thread_create_internal (mono_get_root_domain (), socket_io_epoll_main, data, TRUE); |
| 774 |
} |
772 |
} |
| 775 |
#endif |
773 |
#endif |
| 776 |
InterlockedCompareExchange (&data->inited, 1, 0); |
774 |
InterlockedCompareExchange (&data->inited, 1, 0); |
|
Lines 1053-1059
Link Here
|
| 1053 |
worker < mono_max_worker_threads) { |
1051 |
worker < mono_max_worker_threads) { |
| 1054 |
InterlockedIncrement (&mono_worker_threads); |
1052 |
InterlockedIncrement (&mono_worker_threads); |
| 1055 |
InterlockedIncrement (&busy_worker_threads); |
1053 |
InterlockedIncrement (&busy_worker_threads); |
| 1056 |
mono_thread_create (mono_get_root_domain (), async_invoke_thread, ares); |
1054 |
mono_thread_create_internal (mono_get_root_domain (), async_invoke_thread, ares, TRUE); |
| 1057 |
} else { |
1055 |
} else { |
| 1058 |
append_job (&mono_delegate_section, &async_call_queue, (MonoObject*)ares); |
1056 |
append_job (&mono_delegate_section, &async_call_queue, (MonoObject*)ares); |
| 1059 |
ReleaseSemaphore (job_added, 1, NULL); |
1057 |
ReleaseSemaphore (job_added, 1, NULL); |