summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorBertrik Sikken <bertrik@sikken.nl>2008-05-28 18:12:13 +0000
committerBertrik Sikken <bertrik@sikken.nl>2008-05-28 18:12:13 +0000
commit5c5e8491962e7de20b74cc7ab61d65d52693de11 (patch)
tree6549950a13304bcfa50f8d46c9b0fd0d989b9d6e /apps
parent06b53321b4a30c6efe1d3cfba5467653cfbfc434 (diff)
downloadrockbox-5c5e8491962e7de20b74cc7ab61d65d52693de11.tar.gz
rockbox-5c5e8491962e7de20b74cc7ab61d65d52693de11.tar.bz2
rockbox-5c5e8491962e7de20b74cc7ab61d65d52693de11.zip
Remove racy call to unregister_ata_idle_func and remove unnecessary check before calling register_ata_idle_func. Should fix FS#8993 - Freeze on shutting down.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17647 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/scrobbler.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/apps/scrobbler.c b/apps/scrobbler.c
index c109439263..a4dd2847ec 100644
--- a/apps/scrobbler.c
+++ b/apps/scrobbler.c
@@ -61,7 +61,6 @@ static int cache_pos;
static struct mp3entry scrobbler_entry;
static bool pending = false;
static bool scrobbler_initialised = false;
-static bool scrobbler_ata_callback = false;
#if CONFIG_RTC
static time_t timestamp;
#else
@@ -81,8 +80,6 @@ static void write_cache(void)
int i;
int fd;
- scrobbler_ata_callback = false;
-
/* If the file doesn't exist, create it.
Check at each write since file may be deleted at any time */
if(!file_exists(SCROBBLER_FILE))
@@ -178,11 +175,7 @@ static void add_to_cache(unsigned long play_length)
logf("SCROBBLER: %s", scrobbler_entry.path);
} else {
cache_pos++;
- if (!scrobbler_ata_callback)
- {
- register_ata_idle_func(scrobbler_flush_callback);
- scrobbler_ata_callback = true;
- }
+ register_ata_idle_func(scrobbler_flush_callback);
}
}
@@ -249,14 +242,6 @@ void scrobbler_flush_cache(void)
void scrobbler_shutdown(void)
{
-#ifndef SIMULATOR
- if (scrobbler_ata_callback)
- {
- unregister_ata_idle_func(scrobbler_flush_callback, false);
- scrobbler_ata_callback = false;
- }
-#endif
-
scrobbler_flush_cache();
if (scrobbler_initialised)