In message <[EMAIL PROTECTED]>, John Tytgat wrote:

> In message <[EMAIL PROTECTED]>
>           Adam <[EMAIL PROTECTED]> wrote:
> 
> > Hi,
> > 
> > On comp.sys.acorn.programmer, John wrote:
> > > I haven't followed the rest of this thread but if you think there is
> > > still a problem with UnixLib's thread implementation, feel free to
> > > discuss this in the gccsdk mailing list.
> > 
> > Well, I think it's more likely that I'm doing something wrong. However,
> > I'm having a problem trying to use Wimp_StartTask in a wimp task which
> > has two threads.
> > 
> > If I call Wimp_StartTask before the second thread (e.g. the first one
> > explicitly created by me) is pthread_created then eveything is OK, but
> > if I call the SWI after that point the "child" task crashes - with
> > symptoms ranging from a complete freeze of the machine to data aborts.
> > 
> > I can put together some example code if it helps.
> 
> Ah, Wimp_StartTask. I'm not surprised that this doesn't work.  The
> threading itself needs to be stopped when you're creating a new task as
> there are certainly moments where it doesn't like to see it switched.
> So call __pthread_stop_ticker() before your Wimp_StartTask SWI and
> __pthread_start_ticker() afterwards to reenable the threads.  I expect
> that makes the crashes go away.

Yes, thanks, that did the trick :)

Adam

-- 
Adam Richardson          Carpe Diem
http://www.snowstone.org.uk/riscos/

_______________________________________________
GCCSDK mailing list [email protected]
Bugzilla: http://www.riscos.info/bugzilla/index.cgi
List Info: http://www.riscos.info/mailman/listinfo/gcc
Main Page: http://www.riscos.info/index.php/GCCSDK

Reply via email to