Skip to content
Snippets Groups Projects
Commit 0ab1d4be authored by Oleg Hahm's avatar Oleg Hahm
Browse files

tests: swap thread priorities in msg_snd_rcv test

c3f7925c was the wrong fix for the described problem. The replying thread 2 needs a higher priority because otherwise the sender thread 1 may send before 2 is in receiving mode again.
parent 2cd2738e
No related branches found
No related tags found
No related merge requests found
# name of your application # name of your application
APPLICATION = msg_send_receive APPLICATION = msg_send_receive
USEMODULE += xtimer
include ../Makefile.tests_common include ../Makefile.tests_common
include $(RIOTBASE)/Makefile.include include $(RIOTBASE)/Makefile.include
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include "cpu_conf.h" #include "cpu_conf.h"
#include "thread.h" #include "thread.h"
#include "xtimer.h"
#define THREAD1_STACKSIZE (THREAD_STACKSIZE_MAIN) #define THREAD1_STACKSIZE (THREAD_STACKSIZE_MAIN)
#define THREAD2_STACKSIZE (THREAD_STACKSIZE_MAIN) #define THREAD2_STACKSIZE (THREAD_STACKSIZE_MAIN)
...@@ -58,7 +57,6 @@ static void *thread1(void *args) ...@@ -58,7 +57,6 @@ static void *thread1(void *args)
success = 0; success = 0;
break; break;
} }
xtimer_usleep(200);
} }
if (success) { if (success) {
...@@ -96,9 +94,9 @@ static void *thread2(void *args) ...@@ -96,9 +94,9 @@ static void *thread2(void *args)
int main(void) int main(void)
{ {
thread2_pid = thread_create(thread2_stack, THREAD2_STACKSIZE, THREAD_PRIORITY_MAIN - 1, thread2_pid = thread_create(thread2_stack, THREAD2_STACKSIZE, THREAD_PRIORITY_MAIN - 2,
0, thread2, NULL, "thread2"); 0, thread2, NULL, "thread2");
thread1_pid = thread_create(thread1_stack, THREAD1_STACKSIZE, THREAD_PRIORITY_MAIN - 2, thread1_pid = thread_create(thread1_stack, THREAD1_STACKSIZE, THREAD_PRIORITY_MAIN - 1,
0, thread1, NULL, "thread1"); 0, thread1, NULL, "thread1");
return 0; return 0;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment