[ECOS] cyg_create_thread question
Stephan Bourduas
stephan.bourduas@videotron.ca
Fri Oct 29 10:06:00 GMT 2004
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
More information about the Ecos-discuss
mailing list