diff options
| author | Brandon Low <lostlogic@rockbox.org> | 2007-11-08 16:06:24 +0000 |
|---|---|---|
| committer | Brandon Low <lostlogic@rockbox.org> | 2007-11-08 16:06:24 +0000 |
| commit | 551db40abb4c9c1664c291bc431c4a3f55e530c7 (patch) | |
| tree | 863fdac809c50b1d16e5f9b81582c826ac289e8b | |
| parent | 1db42433795af7a6d3eebbb8748d4a8d33088b26 (diff) | |
| download | rockbox-551db40abb4c9c1664c291bc431c4a3f55e530c7.zip rockbox-551db40abb4c9c1664c291bc431c4a3f55e530c7.tar.gz rockbox-551db40abb4c9c1664c291bc431c4a3f55e530c7.tar.bz2 rockbox-551db40abb4c9c1664c291bc431c4a3f55e530c7.tar.xz | |
Clean up a (nearly impossible) null check. Add a comment.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15536 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | apps/buffering.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/apps/buffering.c b/apps/buffering.c index 655e5cf..c59fc52 100644 --- a/apps/buffering.c +++ b/apps/buffering.c @@ -1006,7 +1006,11 @@ static struct memory_handle *prep_bufdata(int handle_id, size_t *size, do { sleep(1); + /* it is not safe for a non-buffering thread to sleep while + * holding a handle */ h = find_handle(handle_id); + if (!h) + return NULL; avail = RINGBUF_SUB(h->widx, h->ridx); } while (h->filerem > 0 && avail < *size); |