From 86900e05c40f7c6ea0b49f357a3b85d0509a035c Mon Sep 17 00:00:00 2001 From: Salikh Zakirov Date: Thu, 15 Mar 2007 20:05:40 +0300 Subject: [PATCH] Add assertions on os_handle --- vm/thread/src/linux/os_thread.c | 1 + vm/thread/src/thread_native_basic.c | 2 ++ 2 files changed, 3 insertions(+), 0 deletions(-) diff --git a/vm/thread/src/linux/os_thread.c b/vm/thread/src/linux/os_thread.c index 63f10ee..cea68f7 100644 --- a/vm/thread/src/linux/os_thread.c +++ b/vm/thread/src/linux/os_thread.c @@ -179,6 +179,7 @@ void os_thread_yield_other(osthread_t os_thread) { yield_other_init_flag = 1; } + assert(os_thread); r = pthread_kill(os_thread, SIGUSR2); if (r == 0) { diff --git a/vm/thread/src/thread_native_basic.c b/vm/thread/src/thread_native_basic.c index 7ef6975..f332731 100644 --- a/vm/thread/src/thread_native_basic.c +++ b/vm/thread/src/thread_native_basic.c @@ -127,6 +127,7 @@ IDATA VMCALL hythread_create_with_group(hythread_t *ret_thread, hythread_group_t r = os_thread_create(&new_thread->os_handle, stacksize, priority, thread_start_proc, (void *)start_proc_data); + assert(/* error */ r || new_thread->os_handle /* or thread created ok */); return r; } @@ -189,6 +190,7 @@ IDATA hythread_attach_to_group(hythread_t * handle, hythread_library_t lib, hyth } thread->library = lib; thread->os_handle = os_thread_current(); + assert(thread->os_handle); TRACE(("TM: native attached: native: %p ", tm_self_tls)); -- 1.5.0.33.g1b20