* Copyright 2011 Xamarin, Inc (http://www.xamarin.com)
*
* See LICENSE for licensing information.
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
#include <config.h>
#include <signal.h>
MONO_SIG_HANDLER_FUNC (static, sigprof_signal_handler)
{
- MonoThreadInfo *info;
int old_errno = errno;
int hp_save_index;
MONO_SIG_HANDLER_GET_CONTEXT;
/* If we can't consume a profiling request it means we're the initiator. */
if (!(mono_threads_consume_async_jobs () & MONO_SERVICE_REQUEST_SAMPLE)) {
FOREACH_THREAD_SAFE (info) {
- if (mono_thread_info_get_tid (info) == mono_native_thread_id_get ())
+ if (mono_thread_info_get_tid (info) == mono_native_thread_id_get () ||
+ !mono_thread_info_is_live (info))
continue;
mono_threads_add_async_job (info, MONO_SERVICE_REQUEST_SAMPLE);
mono_threads_pthread_kill (info, profiling_signal_in_use);
- } END_FOREACH_THREAD_SAFE;
+ } FOREACH_THREAD_SAFE_END
}
mono_thread_info_set_is_async_context (TRUE);