{
if (keepalive_stacks)
return;
- MONO_GC_REGISTER_ROOT (keepalive_stacks);
+ MONO_GC_REGISTER_ROOT_PINNING (keepalive_stacks);
keepalive_stacks = mono_g_hash_table_new (NULL, NULL);
}
if (cont->domain)
return mono_get_exception_argument ("cont", "Already marked");
- jit_tls = TlsGetValue (mono_jit_tls_id);
+ jit_tls = mono_native_tls_get_value (mono_jit_tls_id);
lmf = mono_get_lmf();
cont->domain = mono_domain_get ();
cont->thread_id = GetCurrentThreadId ();
MonoLMF *lmf = mono_get_lmf ();
gsize num_bytes;
- if (!cont->domain)
+ if (!cont->domain) {
*e = mono_get_exception_argument ("cont", "Continuation not initialized");
- if (cont->domain != mono_domain_get () || cont->thread_id != GetCurrentThreadId ())
+ return 0;
+ }
+ if (cont->domain != mono_domain_get () || cont->thread_id != GetCurrentThreadId ()) {
*e = mono_get_exception_argument ("cont", "Continuation from another thread or domain");
+ return 0;
+ }
cont->lmf = lmf;
cont->return_ip = __builtin_return_address (0);
if (cont->saved_stack && num_bytes <= cont->stack_alloc_size) {
/* clear to avoid GC retention */
- if (num_bytes < cont->stack_used_size)
+ if (num_bytes < cont->stack_used_size) {
memset ((char*)cont->saved_stack + num_bytes, 0, cont->stack_used_size - num_bytes);
+ cont->stack_used_size = num_bytes;
+ }
} else {
tasklets_lock ();
internal_init ();