This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
RE: question about POSIX thread
- From: Jay Foster <jay at systech dot com>
- To: 'Jonathan Larmour' <jifl at eCosCentric dot com>
- Cc: ecos-discuss at sources dot redhat dot com
- Date: Thu, 26 Jun 2003 14:07:46 -0700
- Subject: RE: [ECOS] question about POSIX thread
Is it OK to start a Posix thread (using pthread_create()) from
cyg_user_start()? This seems to work OK, but what are the kinds of things
that might go wrong if this is not OK?
Jay
-----Original Message-----
From: Jonathan Larmour [mailto:jifl@eCosCentric.com]
Sent: Thursday, June 12, 2003 10:13 PM
To: ZI ZHOU
Cc: ecos-discuss@sources.redhat.com
Subject: Re: [ECOS] question about POSIX thread
ZI ZHOU wrote:
> Hi,
>
> I am trying to find out my current thread using
> pthread_self(), can I call it directly in
> cyg_start()?in other words, is cyg_start() considered
> a main thread?
No.
> Or should I create a thread in
> cyg_start() and call pthread_self() within this
> thread? How about cyg_thread_self()?
Only create eCos threads from cyg_start(). Create POSIX threads from
main() (and use pthread_create).
Jifl
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss