[746] MacRuby/trunk/thread_pthread.c
Revision: 746 http://trac.macosforge.org/projects/ruby/changeset/746 Author: lsansonetti@apple.com Date: 2008-11-14 21:36:04 -0800 (Fri, 14 Nov 2008) Log Message: ----------- make sure our thread object remains alive from the pthread_create call to our callback (thanks Vincent Isambart for debugging) Modified Paths: -------------- MacRuby/trunk/thread_pthread.c Modified: MacRuby/trunk/thread_pthread.c =================================================================== --- MacRuby/trunk/thread_pthread.c 2008-11-14 22:00:34 UTC (rev 745) +++ MacRuby/trunk/thread_pthread.c 2008-11-15 05:36:04 UTC (rev 746) @@ -169,6 +169,7 @@ { #if WITH_OBJC rb_objc_gc_register_thread(); + rb_objc_release((void *)th_ptr); #endif #if USE_THREAD_CACHE thread_start: @@ -327,6 +328,7 @@ CHECK_ERR(pthread_attr_setinheritsched(&attr, PTHREAD_INHERIT_SCHED)); CHECK_ERR(pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED)); + rb_objc_retain((void *)th); err = pthread_create(&th->thread_id, &attr, thread_start_func_1, th); thread_debug("create: %p (%d)", th, err); CHECK_ERR(pthread_attr_destroy(&attr));
participants (1)
-
source_changes@macosforge.org