summaryrefslogtreecommitdiff
path: root/apps/buffering.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2008-03-25 02:34:12 +0000
committerMichael Sevakis <jethead71@rockbox.org>2008-03-25 02:34:12 +0000
commit27cf67733936abd75fcb1f8da765977cd75906ee (patch)
treef894211a8a0c77b402dd3250b2bee2d17dcfe13f /apps/buffering.c
parentbc2f8fd8f38a3e010cd67bbac358f6e9991153c6 (diff)
downloadrockbox-27cf67733936abd75fcb1f8da765977cd75906ee.tar.gz
rockbox-27cf67733936abd75fcb1f8da765977cd75906ee.zip
Add a complete priority inheritance implementation to the scheduler (all mutex ownership and queue_send calls are inheritable). Priorities are differential so that dispatch depends on the runnable range of priorities. Codec priority can therefore be raised in small steps (pcmbuf updated to enable). Simplify the kernel functions to ease implementation and use the same kernel.c for both sim and target (I'm tired of maintaining two ;_). 1) Not sure if a minor audio break at first buffering issue will exist on large-sector disks (the main mutex speed issue was genuinely resolved earlier). At this point it's best dealt with at the buffering level. It seems a larger filechunk could be used again. 2) Perhaps 64-bit sims will have some minor issues (finicky) but a backroll of the code of concern there is a 5-minute job. All kernel objects become incompatible so a full rebuild and update is needed.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16791 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/buffering.c')
-rw-r--r--apps/buffering.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/apps/buffering.c b/apps/buffering.c
index 64f522c52f..0cb428c947 100644
--- a/apps/buffering.c
+++ b/apps/buffering.c
@@ -1446,16 +1446,21 @@ void buffering_thread(void)
1446 1446
1447void buffering_init(void) { 1447void buffering_init(void) {
1448 mutex_init(&llist_mutex); 1448 mutex_init(&llist_mutex);
1449#ifdef HAVE_PRIORITY_SCHEDULING
1450 /* This behavior not safe atm */
1451 mutex_set_preempt(&llist_mutex, false);
1452#endif
1449 1453
1450 conf_watermark = BUFFERING_DEFAULT_WATERMARK; 1454 conf_watermark = BUFFERING_DEFAULT_WATERMARK;
1451 1455
1452 queue_init(&buffering_queue, true); 1456 queue_init(&buffering_queue, true);
1453 queue_enable_queue_send(&buffering_queue, &buffering_queue_sender_list);
1454
1455 buffering_thread_p = create_thread( buffering_thread, buffering_stack, 1457 buffering_thread_p = create_thread( buffering_thread, buffering_stack,
1456 sizeof(buffering_stack), CREATE_THREAD_FROZEN, 1458 sizeof(buffering_stack), CREATE_THREAD_FROZEN,
1457 buffering_thread_name IF_PRIO(, PRIORITY_BUFFERING) 1459 buffering_thread_name IF_PRIO(, PRIORITY_BUFFERING)
1458 IF_COP(, CPU)); 1460 IF_COP(, CPU));
1461
1462 queue_enable_queue_send(&buffering_queue, &buffering_queue_sender_list,
1463 buffering_thread_p);
1459} 1464}
1460 1465
1461/* Initialise the buffering subsystem */ 1466/* Initialise the buffering subsystem */