Re: [Prothon-commits] rev 149 - in trunk: include/prothon src

Ben Collins <[email protected]> Sat, 27 Mar 2004 09:10:46 -0500
Newsgroups gmane.comp.lang.prothon.devel
Message-ID <[email protected]>
> +	if (main_argv_obj && list_len(ist, main_argv_obj)) {
> +		new_thread_obj((apr_thread_start_t)main_thread, main_argv_obj);
> +		/* Grab this lock, so we know main1 thread has started */
> +		pr_lock(&thread_registry_lock); pr_unlock(&thread_registry_lock);
>  
> +	}
> +
>  	threads = get_attr(ist, sys_argv_obj, sym(ist, "threads"));
>  	if (threads) {
>  		int i;
>  		for (i = 0; i < list_len(ist, threads); i++)
> -			start_new_thread((apr_thread_start_t)main_thread, list_item(ist, threads, i));
> +			new_thread_obj((apr_thread_start_t)main_thread, list_item(ist, threads, i));
>  	}

Mark, I think you need to release that pr_lock() before starting new
threads, else you'll get a deadlock when new_thread_obj() tries to lock
it again. If you aren't, then something is wrong with locking :)

-- 
Debian     - http://www.debian.org/
Linux 1394 - http://www.linux1394.org/
Subversion - http://subversion.tigris.org/
WatchGuard - http://www.watchguard.com/