This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
cyg_create_thread question
- From: Stephan Bourduas <stephan dot bourduas at videotron dot ca>
- To: ecos-discuss at sources dot redhat dot com
- Date: Fri, 29 Oct 2004 06:00:19 -0400
- Subject: [ECOS] cyg_create_thread question
- Reply-to: stephan at macs dot ece dot mcgill dot ca
This is more of a C/C++ question. Can someone tell me
exactly what "new((void *)thread)" thread does? The code
is taken from kapi.cxx.
externC void cyg_thread_create(
cyg_addrword_t sched_info, /* scheduling info (eg pri) */
cyg_thread_entry_t *entry, /* entry point function */
cyg_addrword_t entry_data, /* entry data */
char *name, /* optional thread name */
void *stack_base, /* stack base, NULL = alloc */
cyg_ucount32 stack_size, /* stack size, 0 = default */
cyg_handle_t *handle, /* returned thread handle */
cyg_thread *thread /* put thread here */
) __THROW
{
CYG_ASSERT_SIZES( cyg_thread, Cyg_Thread );
Cyg_Thread *t = new((void *)thread) Cyg_Thread (
(CYG_ADDRWORD) sched_info,
(cyg_thread_entry *)entry,
(CYG_ADDRWORD) entry_data,
name,
(CYG_ADDRWORD) stack_base,
stack_size
);
t=t;
CYG_CHECK_DATA_PTR( handle, "Bad handle pointer" );
*handle = (cyg_handle_t)thread;
}
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss