summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2011-02-12 12:33:43 +0000
committerMichael Sevakis <jethead71@rockbox.org>2011-02-12 12:33:43 +0000
commit50c727ce7a0064d9c56bc5a963f3fb1f32726276 (patch)
treec9686f27f0500f84084be2d281ee4b3b0fb0953c
parent3c81bf0c136a93751abde073dcaebf1a998f1303 (diff)
downloadrockbox-50c727ce7a0064d9c56bc5a963f3fb1f32726276.tar.gz
rockbox-50c727ce7a0064d9c56bc5a963f3fb1f32726276.zip
Oops. Put back some changes to go only with others.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29289 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/buffering.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/apps/buffering.c b/apps/buffering.c
index 9bc5abd963..48ef1bc6c0 100644
--- a/apps/buffering.c
+++ b/apps/buffering.c
@@ -450,6 +450,9 @@ static bool move_handle(struct memory_handle **h, size_t *delta,
450 return false; 450 return false;
451 } 451 }
452 452
453 mutex_lock(&llist_mutex);
454 mutex_lock(&llist_mod_mutex);
455
453 oldpos = ringbuf_offset(src); 456 oldpos = ringbuf_offset(src);
454 newpos = ringbuf_add(oldpos, final_delta); 457 newpos = ringbuf_add(oldpos, final_delta);
455 overlap = ringbuf_add_cross(newpos, size_to_move, buffer_len); 458 overlap = ringbuf_add_cross(newpos, size_to_move, buffer_len);
@@ -475,6 +478,8 @@ static bool move_handle(struct memory_handle **h, size_t *delta,
475 correction = (correction + 3) & ~3; 478 correction = (correction + 3) & ~3;
476 if (final_delta < correction + sizeof(struct memory_handle)) { 479 if (final_delta < correction + sizeof(struct memory_handle)) {
477 /* Delta cannot end up less than the size of the struct */ 480 /* Delta cannot end up less than the size of the struct */
481 mutex_unlock(&llist_mod_mutex);
482 mutex_unlock(&llist_mutex);
478 return false; 483 return false;
479 } 484 }
480 newpos -= correction; 485 newpos -= correction;
@@ -496,6 +501,8 @@ static bool move_handle(struct memory_handle **h, size_t *delta,
496 if (m && m->next == src) { 501 if (m && m->next == src) {
497 m->next = dest; 502 m->next = dest;
498 } else { 503 } else {
504 mutex_unlock(&llist_mod_mutex);
505 mutex_unlock(&llist_mutex);
499 return false; 506 return false;
500 } 507 }
501 } 508 }
@@ -556,6 +563,8 @@ static bool move_handle(struct memory_handle **h, size_t *delta,
556 /* Update the caller with the new location of h and the distance moved */ 563 /* Update the caller with the new location of h and the distance moved */
557 *h = dest; 564 *h = dest;
558 *delta = final_delta; 565 *delta = final_delta;
566 mutex_unlock(&llist_mod_mutex);
567 mutex_unlock(&llist_mutex);
559 return true; 568 return true;
560} 569}
561 570