From fdf6da07eb4165baaad6f3326a1a8779034d649e Mon Sep 17 00:00:00 2001 From: Oleg Hahm <oleg@hobbykeller.org> Date: Fri, 27 Nov 2015 18:04:42 +0100 Subject: [PATCH] examples: every socket thread needs a msg queue --- examples/posix_sockets/main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/posix_sockets/main.c b/examples/posix_sockets/main.c index 995019ad8c..de60a3bb13 100644 --- a/examples/posix_sockets/main.c +++ b/examples/posix_sockets/main.c @@ -20,9 +20,11 @@ #include <stdio.h> +#include "msg.h" #include "shell.h" -#define MAIN_MSG_QUEUE_SIZE (1) +#define MAIN_MSG_QUEUE_SIZE (4) +static msg_t main_msg_queue[MAIN_MSG_QUEUE_SIZE]; extern int udp_cmd(int argc, char **argv); @@ -33,6 +35,9 @@ static const shell_command_t shell_commands[] = { int main(void) { + /* a sendto() call performs an implicit bind(), hence, a message queue is + * required for the thread executing the shell */ + msg_init_queue(main_msg_queue, MAIN_MSG_QUEUE_SIZE); puts("RIOT socket example application"); /* start shell */ puts("All up, running the shell now"); -- GitLab