diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2008-12-10 08:57:10 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2008-12-10 08:57:10 +0000 |
commit | 8cfbd3604fac14f629244e521ad24ffa9938c790 (patch) | |
tree | 16dc096519b8b537bb7d4b73e0c97f5f33ee752b /apps/plugins | |
parent | 40ff47c7eea41ac893d7af5c5b97ace52a5ffade (diff) | |
download | rockbox-8cfbd3604fac14f629244e521ad24ffa9938c790.tar.gz rockbox-8cfbd3604fac14f629244e521ad24ffa9938c790.zip |
Use cookies for thread identification instead of pointers directly which gives a buffer against wrongly identifying a thread when the slot is recycled (which has been nagging me for awhile). A slot gets 255 uses before it repeats. Everything gets incompatible so a full update is required.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19377 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins')
-rw-r--r-- | apps/plugins/alpine_cdc.c | 2 | ||||
-rw-r--r-- | apps/plugins/battery_bench.c | 4 | ||||
-rw-r--r-- | apps/plugins/mpegplayer/audio_thread.c | 6 | ||||
-rw-r--r-- | apps/plugins/mpegplayer/disk_buf.c | 8 | ||||
-rw-r--r-- | apps/plugins/mpegplayer/disk_buf.h | 2 | ||||
-rw-r--r-- | apps/plugins/mpegplayer/mpeg_parser.c | 2 | ||||
-rw-r--r-- | apps/plugins/mpegplayer/stream_mgr.c | 20 | ||||
-rw-r--r-- | apps/plugins/mpegplayer/stream_mgr.h | 2 | ||||
-rw-r--r-- | apps/plugins/mpegplayer/stream_thread.h | 2 | ||||
-rw-r--r-- | apps/plugins/mpegplayer/video_thread.c | 6 | ||||
-rw-r--r-- | apps/plugins/pictureflow.c | 4 | ||||
-rw-r--r-- | apps/plugins/test_codec.c | 4 | ||||
-rw-r--r-- | apps/plugins/test_sampr.c | 14 |
13 files changed, 38 insertions, 38 deletions
diff --git a/apps/plugins/alpine_cdc.c b/apps/plugins/alpine_cdc.c index dfffc3b3cd..d15e26ae36 100644 --- a/apps/plugins/alpine_cdc.c +++ b/apps/plugins/alpine_cdc.c | |||
@@ -206,7 +206,7 @@ struct | |||
206 | { | 206 | { |
207 | bool foreground; /* set as long as we're owning the UI */ | 207 | bool foreground; /* set as long as we're owning the UI */ |
208 | bool exiting; /* signal to the thread that we want to exit */ | 208 | bool exiting; /* signal to the thread that we want to exit */ |
209 | struct thread_entry *thread; /* worker thread id */ | 209 | unsigned int thread; /* worker thread id */ |
210 | } gTread; | 210 | } gTread; |
211 | 211 | ||
212 | static const struct plugin_api* rb; /* here is the global API struct pointer */ | 212 | static const struct plugin_api* rb; /* here is the global API struct pointer */ |
diff --git a/apps/plugins/battery_bench.c b/apps/plugins/battery_bench.c index b951b01432..0c30ebabc3 100644 --- a/apps/plugins/battery_bench.c +++ b/apps/plugins/battery_bench.c | |||
@@ -216,7 +216,7 @@ struct batt_info | |||
216 | 216 | ||
217 | #define BUF_ELEMENTS (sizeof(bat)/sizeof(struct batt_info)) | 217 | #define BUF_ELEMENTS (sizeof(bat)/sizeof(struct batt_info)) |
218 | 218 | ||
219 | static struct thread_entry *thread_id; | 219 | static unsigned int thread_id; |
220 | static struct event_queue thread_q; | 220 | static struct event_queue thread_q; |
221 | static bool in_usb_mode; | 221 | static bool in_usb_mode; |
222 | static unsigned int buf_idx; | 222 | static unsigned int buf_idx; |
@@ -537,7 +537,7 @@ int main(void) | |||
537 | if ((thread_id = rb->create_thread(thread, thread_stack, | 537 | if ((thread_id = rb->create_thread(thread, thread_stack, |
538 | sizeof(thread_stack), 0, "Battery Benchmark" | 538 | sizeof(thread_stack), 0, "Battery Benchmark" |
539 | IF_PRIO(, PRIORITY_BACKGROUND) | 539 | IF_PRIO(, PRIORITY_BACKGROUND) |
540 | IF_COP(, CPU))) == NULL) | 540 | IF_COP(, CPU))) == 0) |
541 | { | 541 | { |
542 | rb->splash(HZ, "Cannot create thread!"); | 542 | rb->splash(HZ, "Cannot create thread!"); |
543 | return PLUGIN_ERROR; | 543 | return PLUGIN_ERROR; |
diff --git a/apps/plugins/mpegplayer/audio_thread.c b/apps/plugins/mpegplayer/audio_thread.c index 45226575c9..2fb46efd56 100644 --- a/apps/plugins/mpegplayer/audio_thread.c +++ b/apps/plugins/mpegplayer/audio_thread.c | |||
@@ -732,7 +732,7 @@ bool audio_thread_init(void) | |||
732 | rb->queue_enable_queue_send(audio_str.hdr.q, &audio_str_queue_send, | 732 | rb->queue_enable_queue_send(audio_str.hdr.q, &audio_str_queue_send, |
733 | audio_str.thread); | 733 | audio_str.thread); |
734 | 734 | ||
735 | if (audio_str.thread == NULL) | 735 | if (audio_str.thread == 0) |
736 | return false; | 736 | return false; |
737 | 737 | ||
738 | /* Wait for thread to initialize */ | 738 | /* Wait for thread to initialize */ |
@@ -744,11 +744,11 @@ bool audio_thread_init(void) | |||
744 | /* Stops the audio thread */ | 744 | /* Stops the audio thread */ |
745 | void audio_thread_exit(void) | 745 | void audio_thread_exit(void) |
746 | { | 746 | { |
747 | if (audio_str.thread != NULL) | 747 | if (audio_str.thread != 0) |
748 | { | 748 | { |
749 | str_post_msg(&audio_str, STREAM_QUIT, 0); | 749 | str_post_msg(&audio_str, STREAM_QUIT, 0); |
750 | rb->thread_wait(audio_str.thread); | 750 | rb->thread_wait(audio_str.thread); |
751 | audio_str.thread = NULL; | 751 | audio_str.thread = 0; |
752 | } | 752 | } |
753 | 753 | ||
754 | #ifndef SIMULATOR | 754 | #ifndef SIMULATOR |
diff --git a/apps/plugins/mpegplayer/disk_buf.c b/apps/plugins/mpegplayer/disk_buf.c index df5e005b50..c008139356 100644 --- a/apps/plugins/mpegplayer/disk_buf.c +++ b/apps/plugins/mpegplayer/disk_buf.c | |||
@@ -835,7 +835,7 @@ void disk_buf_reply_msg(intptr_t retval) | |||
835 | 835 | ||
836 | bool disk_buf_init(void) | 836 | bool disk_buf_init(void) |
837 | { | 837 | { |
838 | disk_buf.thread = NULL; | 838 | disk_buf.thread = 0; |
839 | list_initialize(&nf_list); | 839 | list_initialize(&nf_list); |
840 | 840 | ||
841 | rb->mutex_init(&disk_buf_mtx); | 841 | rb->mutex_init(&disk_buf_mtx); |
@@ -893,7 +893,7 @@ bool disk_buf_init(void) | |||
893 | rb->queue_enable_queue_send(disk_buf.q, &disk_buf_queue_send, | 893 | rb->queue_enable_queue_send(disk_buf.q, &disk_buf_queue_send, |
894 | disk_buf.thread); | 894 | disk_buf.thread); |
895 | 895 | ||
896 | if (disk_buf.thread == NULL) | 896 | if (disk_buf.thread == 0) |
897 | return false; | 897 | return false; |
898 | 898 | ||
899 | /* Wait for thread to initialize */ | 899 | /* Wait for thread to initialize */ |
@@ -904,10 +904,10 @@ bool disk_buf_init(void) | |||
904 | 904 | ||
905 | void disk_buf_exit(void) | 905 | void disk_buf_exit(void) |
906 | { | 906 | { |
907 | if (disk_buf.thread != NULL) | 907 | if (disk_buf.thread != 0) |
908 | { | 908 | { |
909 | rb->queue_post(disk_buf.q, STREAM_QUIT, 0); | 909 | rb->queue_post(disk_buf.q, STREAM_QUIT, 0); |
910 | rb->thread_wait(disk_buf.thread); | 910 | rb->thread_wait(disk_buf.thread); |
911 | disk_buf.thread = NULL; | 911 | disk_buf.thread = 0; |
912 | } | 912 | } |
913 | } | 913 | } |
diff --git a/apps/plugins/mpegplayer/disk_buf.h b/apps/plugins/mpegplayer/disk_buf.h index b6399c81d1..e16939a92e 100644 --- a/apps/plugins/mpegplayer/disk_buf.h +++ b/apps/plugins/mpegplayer/disk_buf.h | |||
@@ -62,7 +62,7 @@ struct dbuf_range | |||
62 | * playback events as well as buffering */ | 62 | * playback events as well as buffering */ |
63 | struct disk_buf | 63 | struct disk_buf |
64 | { | 64 | { |
65 | struct thread_entry *thread; | 65 | unsigned int thread; |
66 | struct event_queue *q; | 66 | struct event_queue *q; |
67 | uint8_t *start; /* Start pointer */ | 67 | uint8_t *start; /* Start pointer */ |
68 | uint8_t *end; /* End of buffer pointer less MPEG_GUARDBUF_SIZE. The | 68 | uint8_t *end; /* End of buffer pointer less MPEG_GUARDBUF_SIZE. The |
diff --git a/apps/plugins/mpegplayer/mpeg_parser.c b/apps/plugins/mpegplayer/mpeg_parser.c index 54a6f23d92..42c388b375 100644 --- a/apps/plugins/mpegplayer/mpeg_parser.c +++ b/apps/plugins/mpegplayer/mpeg_parser.c | |||
@@ -1027,7 +1027,7 @@ intptr_t parser_send_video_msg(long id, intptr_t data) | |||
1027 | { | 1027 | { |
1028 | intptr_t retval = 0; | 1028 | intptr_t retval = 0; |
1029 | 1029 | ||
1030 | if (video_str.thread != NULL && disk_buf.in_file >= 0) | 1030 | if (video_str.thread != 0 && disk_buf.in_file >= 0) |
1031 | { | 1031 | { |
1032 | /* Hook certain messages since they involve multiple operations | 1032 | /* Hook certain messages since they involve multiple operations |
1033 | * behind the scenes */ | 1033 | * behind the scenes */ |
diff --git a/apps/plugins/mpegplayer/stream_mgr.c b/apps/plugins/mpegplayer/stream_mgr.c index 424d2fe503..222ffb7d6b 100644 --- a/apps/plugins/mpegplayer/stream_mgr.c +++ b/apps/plugins/mpegplayer/stream_mgr.c | |||
@@ -908,7 +908,7 @@ static void stream_mgr_thread(void) | |||
908 | /* Opens a new file */ | 908 | /* Opens a new file */ |
909 | int stream_open(const char *filename) | 909 | int stream_open(const char *filename) |
910 | { | 910 | { |
911 | if (stream_mgr.thread != NULL) | 911 | if (stream_mgr.thread != 0) |
912 | return stream_mgr_send_msg(STREAM_OPEN, (intptr_t)filename); | 912 | return stream_mgr_send_msg(STREAM_OPEN, (intptr_t)filename); |
913 | return STREAM_ERROR; | 913 | return STREAM_ERROR; |
914 | } | 914 | } |
@@ -916,7 +916,7 @@ int stream_open(const char *filename) | |||
916 | /* Plays the current file starting at time 'start' */ | 916 | /* Plays the current file starting at time 'start' */ |
917 | int stream_play(void) | 917 | int stream_play(void) |
918 | { | 918 | { |
919 | if (stream_mgr.thread != NULL) | 919 | if (stream_mgr.thread != 0) |
920 | return stream_mgr_send_msg(STREAM_PLAY, 0); | 920 | return stream_mgr_send_msg(STREAM_PLAY, 0); |
921 | return STREAM_ERROR; | 921 | return STREAM_ERROR; |
922 | } | 922 | } |
@@ -924,7 +924,7 @@ int stream_play(void) | |||
924 | /* Pauses playback if playing */ | 924 | /* Pauses playback if playing */ |
925 | int stream_pause(void) | 925 | int stream_pause(void) |
926 | { | 926 | { |
927 | if (stream_mgr.thread != NULL) | 927 | if (stream_mgr.thread != 0) |
928 | return stream_mgr_send_msg(STREAM_PAUSE, false); | 928 | return stream_mgr_send_msg(STREAM_PAUSE, false); |
929 | return STREAM_ERROR; | 929 | return STREAM_ERROR; |
930 | } | 930 | } |
@@ -932,7 +932,7 @@ int stream_pause(void) | |||
932 | /* Resumes playback if paused */ | 932 | /* Resumes playback if paused */ |
933 | int stream_resume(void) | 933 | int stream_resume(void) |
934 | { | 934 | { |
935 | if (stream_mgr.thread != NULL) | 935 | if (stream_mgr.thread != 0) |
936 | return stream_mgr_send_msg(STREAM_PAUSE, true); | 936 | return stream_mgr_send_msg(STREAM_PAUSE, true); |
937 | return STREAM_ERROR; | 937 | return STREAM_ERROR; |
938 | } | 938 | } |
@@ -940,7 +940,7 @@ int stream_resume(void) | |||
940 | /* Stops playback if not stopped */ | 940 | /* Stops playback if not stopped */ |
941 | int stream_stop(void) | 941 | int stream_stop(void) |
942 | { | 942 | { |
943 | if (stream_mgr.thread != NULL) | 943 | if (stream_mgr.thread != 0) |
944 | return stream_mgr_send_msg(STREAM_STOP, 0); | 944 | return stream_mgr_send_msg(STREAM_STOP, 0); |
945 | return STREAM_ERROR; | 945 | return STREAM_ERROR; |
946 | } | 946 | } |
@@ -950,7 +950,7 @@ int stream_seek(uint32_t time, int whence) | |||
950 | { | 950 | { |
951 | int ret; | 951 | int ret; |
952 | 952 | ||
953 | if (stream_mgr.thread == NULL) | 953 | if (stream_mgr.thread == 0) |
954 | return STREAM_ERROR; | 954 | return STREAM_ERROR; |
955 | 955 | ||
956 | stream_mgr_lock(); | 956 | stream_mgr_lock(); |
@@ -968,7 +968,7 @@ int stream_seek(uint32_t time, int whence) | |||
968 | /* Closes the current file */ | 968 | /* Closes the current file */ |
969 | int stream_close(void) | 969 | int stream_close(void) |
970 | { | 970 | { |
971 | if (stream_mgr.thread != NULL) | 971 | if (stream_mgr.thread != 0) |
972 | return stream_mgr_send_msg(STREAM_CLOSE, 0); | 972 | return stream_mgr_send_msg(STREAM_CLOSE, 0); |
973 | return STREAM_ERROR; | 973 | return STREAM_ERROR; |
974 | } | 974 | } |
@@ -1018,7 +1018,7 @@ int stream_init(void) | |||
1018 | rb->queue_enable_queue_send(stream_mgr.q, &stream_mgr_queue_send, | 1018 | rb->queue_enable_queue_send(stream_mgr.q, &stream_mgr_queue_send, |
1019 | stream_mgr.thread); | 1019 | stream_mgr.thread); |
1020 | 1020 | ||
1021 | if (stream_mgr.thread == NULL) | 1021 | if (stream_mgr.thread == 0) |
1022 | { | 1022 | { |
1023 | rb->splash(HZ, "Could not create stream manager thread!"); | 1023 | rb->splash(HZ, "Could not create stream manager thread!"); |
1024 | return STREAM_ERROR; | 1024 | return STREAM_ERROR; |
@@ -1073,11 +1073,11 @@ void stream_exit(void) | |||
1073 | disk_buf_exit(); | 1073 | disk_buf_exit(); |
1074 | pcm_output_exit(); | 1074 | pcm_output_exit(); |
1075 | 1075 | ||
1076 | if (stream_mgr.thread != NULL) | 1076 | if (stream_mgr.thread != 0) |
1077 | { | 1077 | { |
1078 | stream_mgr_post_msg(STREAM_QUIT, 0); | 1078 | stream_mgr_post_msg(STREAM_QUIT, 0); |
1079 | rb->thread_wait(stream_mgr.thread); | 1079 | rb->thread_wait(stream_mgr.thread); |
1080 | stream_mgr.thread = NULL; | 1080 | stream_mgr.thread = 0; |
1081 | } | 1081 | } |
1082 | 1082 | ||
1083 | #ifndef HAVE_LCD_COLOR | 1083 | #ifndef HAVE_LCD_COLOR |
diff --git a/apps/plugins/mpegplayer/stream_mgr.h b/apps/plugins/mpegplayer/stream_mgr.h index e3ea9207e6..a00b39f189 100644 --- a/apps/plugins/mpegplayer/stream_mgr.h +++ b/apps/plugins/mpegplayer/stream_mgr.h | |||
@@ -27,7 +27,7 @@ | |||
27 | * coordination with assistance from the parser */ | 27 | * coordination with assistance from the parser */ |
28 | struct stream_mgr | 28 | struct stream_mgr |
29 | { | 29 | { |
30 | struct thread_entry *thread; /* Playback control thread */ | 30 | unsigned int thread; /* Playback control thread */ |
31 | struct event_queue *q; /* event queue for control thread */ | 31 | struct event_queue *q; /* event queue for control thread */ |
32 | const char *filename; /* Current filename */ | 32 | const char *filename; /* Current filename */ |
33 | uint32_t resume_time; /* The stream tick where playback was | 33 | uint32_t resume_time; /* The stream tick where playback was |
diff --git a/apps/plugins/mpegplayer/stream_thread.h b/apps/plugins/mpegplayer/stream_thread.h index d6e42d274f..30bf46e6ff 100644 --- a/apps/plugins/mpegplayer/stream_thread.h +++ b/apps/plugins/mpegplayer/stream_thread.h | |||
@@ -45,7 +45,7 @@ struct stream_hdr | |||
45 | struct stream | 45 | struct stream |
46 | { | 46 | { |
47 | struct stream_hdr hdr; /* Base stream data */ | 47 | struct stream_hdr hdr; /* Base stream data */ |
48 | struct thread_entry *thread; /* Stream's thread */ | 48 | unsigned int thread; /* Stream's thread */ |
49 | uint8_t* curr_packet; /* Current stream packet beginning */ | 49 | uint8_t* curr_packet; /* Current stream packet beginning */ |
50 | uint8_t* curr_packet_end; /* Current stream packet end */ | 50 | uint8_t* curr_packet_end; /* Current stream packet end */ |
51 | struct list_item l; /* List of streams - either reserve pool | 51 | struct list_item l; /* List of streams - either reserve pool |
diff --git a/apps/plugins/mpegplayer/video_thread.c b/apps/plugins/mpegplayer/video_thread.c index 100904b01b..8b84686a3b 100644 --- a/apps/plugins/mpegplayer/video_thread.c +++ b/apps/plugins/mpegplayer/video_thread.c | |||
@@ -1009,7 +1009,7 @@ bool video_thread_init(void) | |||
1009 | rb->queue_enable_queue_send(video_str.hdr.q, &video_str_queue_send, | 1009 | rb->queue_enable_queue_send(video_str.hdr.q, &video_str_queue_send, |
1010 | video_str.thread); | 1010 | video_str.thread); |
1011 | 1011 | ||
1012 | if (video_str.thread == NULL) | 1012 | if (video_str.thread == 0) |
1013 | return false; | 1013 | return false; |
1014 | 1014 | ||
1015 | /* Wait for thread to initialize */ | 1015 | /* Wait for thread to initialize */ |
@@ -1022,11 +1022,11 @@ bool video_thread_init(void) | |||
1022 | /* Terminates the video thread */ | 1022 | /* Terminates the video thread */ |
1023 | void video_thread_exit(void) | 1023 | void video_thread_exit(void) |
1024 | { | 1024 | { |
1025 | if (video_str.thread != NULL) | 1025 | if (video_str.thread != 0) |
1026 | { | 1026 | { |
1027 | str_post_msg(&video_str, STREAM_QUIT, 0); | 1027 | str_post_msg(&video_str, STREAM_QUIT, 0); |
1028 | rb->thread_wait(video_str.thread); | 1028 | rb->thread_wait(video_str.thread); |
1029 | IF_COP(invalidate_icache()); | 1029 | IF_COP(invalidate_icache()); |
1030 | video_str.thread = NULL; | 1030 | video_str.thread = 0; |
1031 | } | 1031 | } |
1032 | } | 1032 | } |
diff --git a/apps/plugins/pictureflow.c b/apps/plugins/pictureflow.c index 29e8a749d5..232c3f6bc4 100644 --- a/apps/plugins/pictureflow.c +++ b/apps/plugins/pictureflow.c | |||
@@ -218,7 +218,7 @@ struct mutex slide_cache_stack_lock; | |||
218 | 218 | ||
219 | static int empty_slide_hid; | 219 | static int empty_slide_hid; |
220 | 220 | ||
221 | struct thread_entry *thread_id; | 221 | unsigned int thread_id; |
222 | struct event_queue thread_q; | 222 | struct event_queue thread_q; |
223 | 223 | ||
224 | static char tmp_path_name[MAX_PATH]; | 224 | static char tmp_path_name[MAX_PATH]; |
@@ -831,7 +831,7 @@ bool create_pf_thread(void) | |||
831 | IF_PRIO(, PRIORITY_BACKGROUND) | 831 | IF_PRIO(, PRIORITY_BACKGROUND) |
832 | IF_COP(, CPU) | 832 | IF_COP(, CPU) |
833 | ) | 833 | ) |
834 | ) == NULL) { | 834 | ) == 0) { |
835 | return false; | 835 | return false; |
836 | } | 836 | } |
837 | thread_is_running = true; | 837 | thread_is_running = true; |
diff --git a/apps/plugins/test_codec.c b/apps/plugins/test_codec.c index b1f5aff385..17effd8dfd 100644 --- a/apps/plugins/test_codec.c +++ b/apps/plugins/test_codec.c | |||
@@ -525,7 +525,7 @@ static enum plugin_status test_track(const char* filename) | |||
525 | long ticks; | 525 | long ticks; |
526 | unsigned long speed; | 526 | unsigned long speed; |
527 | unsigned long duration; | 527 | unsigned long duration; |
528 | struct thread_entry* codecthread_id; | 528 | unsigned int codecthread_id; |
529 | const char* ch; | 529 | const char* ch; |
530 | 530 | ||
531 | /* Display filename (excluding any path)*/ | 531 | /* Display filename (excluding any path)*/ |
@@ -590,7 +590,7 @@ static enum plugin_status test_track(const char* filename) | |||
590 | 590 | ||
591 | if ((codecthread_id = rb->create_thread(codec_thread, | 591 | if ((codecthread_id = rb->create_thread(codec_thread, |
592 | codec_stack, codec_stack_size, 0, "testcodec" | 592 | codec_stack, codec_stack_size, 0, "testcodec" |
593 | IF_PRIO(,PRIORITY_PLAYBACK) IF_COP(, CPU))) == NULL) | 593 | IF_PRIO(,PRIORITY_PLAYBACK) IF_COP(, CPU))) == 0) |
594 | { | 594 | { |
595 | log_text("Cannot create codec thread!",true); | 595 | log_text("Cannot create codec thread!",true); |
596 | goto exit; | 596 | goto exit; |
diff --git a/apps/plugins/test_sampr.c b/apps/plugins/test_sampr.c index 77f9b8a779..1131a7a989 100644 --- a/apps/plugins/test_sampr.c +++ b/apps/plugins/test_sampr.c | |||
@@ -39,7 +39,7 @@ static unsigned long hw_sampr IDATA_ATTR = HW_SAMPR_DEFAULT; | |||
39 | 39 | ||
40 | static int gen_thread_stack[DEFAULT_STACK_SIZE/sizeof(int)] IBSS_ATTR; | 40 | static int gen_thread_stack[DEFAULT_STACK_SIZE/sizeof(int)] IBSS_ATTR; |
41 | static bool gen_quit IBSS_ATTR; | 41 | static bool gen_quit IBSS_ATTR; |
42 | static struct thread_entry *gen_thread_p; | 42 | static unsigned int gen_thread_id; |
43 | 43 | ||
44 | #define OUTPUT_CHUNK_COUNT (1 << 1) | 44 | #define OUTPUT_CHUNK_COUNT (1 << 1) |
45 | #define OUTPUT_CHUNK_MASK (OUTPUT_CHUNK_COUNT-1) | 45 | #define OUTPUT_CHUNK_MASK (OUTPUT_CHUNK_COUNT-1) |
@@ -233,11 +233,11 @@ static void play_tone(bool volume_set) | |||
233 | output_clear(); | 233 | output_clear(); |
234 | update_gen_step(); | 234 | update_gen_step(); |
235 | 235 | ||
236 | gen_thread_p = rb->create_thread(gen_thread_func, gen_thread_stack, | 236 | gen_thread_id = rb->create_thread(gen_thread_func, gen_thread_stack, |
237 | sizeof(gen_thread_stack), 0, | 237 | sizeof(gen_thread_stack), 0, |
238 | "test_sampr generator" | 238 | "test_sampr generator" |
239 | IF_PRIO(, PRIORITY_PLAYBACK) | 239 | IF_PRIO(, PRIORITY_PLAYBACK) |
240 | IF_COP(, CPU)); | 240 | IF_COP(, CPU)); |
241 | 241 | ||
242 | rb->pcm_play_data(get_more, NULL, 0); | 242 | rb->pcm_play_data(get_more, NULL, 0); |
243 | 243 | ||
@@ -260,7 +260,7 @@ static void play_tone(bool volume_set) | |||
260 | 260 | ||
261 | gen_quit = true; | 261 | gen_quit = true; |
262 | 262 | ||
263 | rb->thread_wait(gen_thread_p); | 263 | rb->thread_wait(gen_thread_id); |
264 | 264 | ||
265 | rb->pcm_play_stop(); | 265 | rb->pcm_play_stop(); |
266 | 266 | ||