Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: Re: Disk hangs creating file in new thread
From: TP Diffenbach (rockbox_at_diffenbach.org)
Date: 2003-08-11


Quoting TP Diffenbach <rockbox_at_diffenbach.org>:

>
> I've writen a thread to do some simple monitoring; one of the first things it
> does
> is create a file.
>
> Well, it tries to: when it creates the file, the drive light comes on and stays
> on
> until the unit is hard re-booted.
>
> Can anyone explain what I'm doing wrong, please?
>
> Incidently, what happens if a thread function returns, because it's done
> doing
> whatever it does, or because it can't do what it does? Is this ok?
>
> Here's the (relevant) code:
>
> static void myThread( void ) {
>
> sleep( 60 * HZ ) ;
>
> /* make sure we can create the file */
> ok = ( fd = creat( "/p.log", O_WRONLY ) ) != -1 ;
>
> if( ok ) {
> close( fd ) ;
> }

The problem appears to have been insufficient stack space. I'd been using
DEFAULT_STACK_SIZE.

The problem goes away when I use 20 * DEFAULT_STACK_SIZE.

This might be something to add to the developer documentation.

-- 
Archos FM has a Rockbox!



Page was last modified "Jan 10 2012" The Rockbox Crew
aaa