diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/codec_thread.c | 2 | ||||
-rw-r--r-- | apps/plugin.c | 1 | ||||
-rw-r--r-- | apps/plugin.h | 3 | ||||
-rw-r--r-- | apps/plugins/mpegplayer/audio_thread.c | 4 | ||||
-rw-r--r-- | apps/recorder/pcm_record.c | 6 |
5 files changed, 9 insertions, 7 deletions
diff --git a/apps/codec_thread.c b/apps/codec_thread.c index f166f2ba18..6f15ba1fb3 100644 --- a/apps/codec_thread.c +++ b/apps/codec_thread.c | |||
@@ -567,7 +567,7 @@ void codec_thread_resume(void) | |||
567 | 567 | ||
568 | bool is_codec_thread(void) | 568 | bool is_codec_thread(void) |
569 | { | 569 | { |
570 | return thread_get_current() == codec_thread_id; | 570 | return thread_self() == codec_thread_id; |
571 | } | 571 | } |
572 | 572 | ||
573 | #ifdef HAVE_PRIORITY_SCHEDULING | 573 | #ifdef HAVE_PRIORITY_SCHEDULING |
diff --git a/apps/plugin.c b/apps/plugin.c index 192488ef81..3807ad5d76 100644 --- a/apps/plugin.c +++ b/apps/plugin.c | |||
@@ -779,6 +779,7 @@ static const struct plugin_api rockbox_api = { | |||
779 | 779 | ||
780 | /* new stuff at the end, sort into place next time | 780 | /* new stuff at the end, sort into place next time |
781 | the API gets incompatible */ | 781 | the API gets incompatible */ |
782 | thread_self, | ||
782 | }; | 783 | }; |
783 | 784 | ||
784 | int plugin_load(const char* plugin, const void* parameter) | 785 | int plugin_load(const char* plugin, const void* parameter) |
diff --git a/apps/plugin.h b/apps/plugin.h index 2275b309d7..43b9818ffd 100644 --- a/apps/plugin.h +++ b/apps/plugin.h | |||
@@ -145,7 +145,7 @@ void* plugin_get_buffer(size_t *buffer_size); | |||
145 | #define PLUGIN_MAGIC 0x526F634B /* RocK */ | 145 | #define PLUGIN_MAGIC 0x526F634B /* RocK */ |
146 | 146 | ||
147 | /* increase this every time the api struct changes */ | 147 | /* increase this every time the api struct changes */ |
148 | #define PLUGIN_API_VERSION 200 | 148 | #define PLUGIN_API_VERSION 201 |
149 | 149 | ||
150 | /* update this to latest version if a change to the api struct breaks | 150 | /* update this to latest version if a change to the api struct breaks |
151 | backwards compatibility (and please take the opportunity to sort in any | 151 | backwards compatibility (and please take the opportunity to sort in any |
@@ -909,6 +909,7 @@ struct plugin_api { | |||
909 | 909 | ||
910 | /* new stuff at the end, sort into place next time | 910 | /* new stuff at the end, sort into place next time |
911 | the API gets incompatible */ | 911 | the API gets incompatible */ |
912 | unsigned int (*thread_self)(void); | ||
912 | }; | 913 | }; |
913 | 914 | ||
914 | /* plugin header */ | 915 | /* plugin header */ |
diff --git a/apps/plugins/mpegplayer/audio_thread.c b/apps/plugins/mpegplayer/audio_thread.c index 45fa7257ef..f976fd6007 100644 --- a/apps/plugins/mpegplayer/audio_thread.c +++ b/apps/plugins/mpegplayer/audio_thread.c | |||
@@ -468,7 +468,7 @@ static void audio_thread(void) | |||
468 | struct audio_thread_data td; | 468 | struct audio_thread_data td; |
469 | #ifdef HAVE_PRIORITY_SCHEDULING | 469 | #ifdef HAVE_PRIORITY_SCHEDULING |
470 | /* Up the priority since the core DSP over-yields internally */ | 470 | /* Up the priority since the core DSP over-yields internally */ |
471 | int old_priority = rb->thread_set_priority(THREAD_ID_CURRENT, | 471 | int old_priority = rb->thread_set_priority(rb->thread_self(), |
472 | PRIORITY_PLAYBACK-4); | 472 | PRIORITY_PLAYBACK-4); |
473 | #endif | 473 | #endif |
474 | 474 | ||
@@ -514,7 +514,7 @@ static void audio_thread(void) | |||
514 | default: | 514 | default: |
515 | { | 515 | { |
516 | #ifdef HAVE_PRIORITY_SCHEDULING | 516 | #ifdef HAVE_PRIORITY_SCHEDULING |
517 | rb->thread_set_priority(THREAD_ID_CURRENT, old_priority); | 517 | rb->thread_set_priority(rb->thread_self(), old_priority); |
518 | #endif | 518 | #endif |
519 | return; | 519 | return; |
520 | } | 520 | } |
diff --git a/apps/recorder/pcm_record.c b/apps/recorder/pcm_record.c index 8c9207f232..8a832e409c 100644 --- a/apps/recorder/pcm_record.c +++ b/apps/recorder/pcm_record.c | |||
@@ -897,8 +897,8 @@ static void pcmrec_flush(unsigned flush_num) | |||
897 | priority until finished */ | 897 | priority until finished */ |
898 | logf("pcmrec: boost (%s)", | 898 | logf("pcmrec: boost (%s)", |
899 | num >= flood_watermark ? "num" : "time"); | 899 | num >= flood_watermark ? "num" : "time"); |
900 | prio_pcmrec = thread_set_priority(THREAD_ID_CURRENT, | 900 | prio_pcmrec = thread_set_priority(thread_self(), |
901 | thread_get_priority(THREAD_ID_CURRENT) - 4); | 901 | thread_get_priority(thread_self()) - 4); |
902 | prio_codec = codec_thread_set_priority( | 902 | prio_codec = codec_thread_set_priority( |
903 | codec_thread_get_priority() - 4); | 903 | codec_thread_get_priority() - 4); |
904 | } | 904 | } |
@@ -950,7 +950,7 @@ static void pcmrec_flush(unsigned flush_num) | |||
950 | { | 950 | { |
951 | /* return to original priorities */ | 951 | /* return to original priorities */ |
952 | logf("pcmrec: unboost priority"); | 952 | logf("pcmrec: unboost priority"); |
953 | thread_set_priority(THREAD_ID_CURRENT, prio_pcmrec); | 953 | thread_set_priority(thread_self(), prio_pcmrec); |
954 | codec_thread_set_priority(prio_codec); | 954 | codec_thread_set_priority(prio_codec); |
955 | } | 955 | } |
956 | 956 | ||