Commit dca8b7b6 authored by Thanassis Tsiodras's avatar Thanassis Tsiodras
Browse files

Added common termination primitive for the worker tasks

Both of the worker tasks must signal their result through the message queue,
and then kill themselves - common work refactored in.
parent 5705e24a
#include <printk.h>
#include "system.h"
void die(int task_no, unsigned exitCode)
rtems_status_code status = RTEMS_SUCCESSFUL;
exitCode = exitCode << 31;
exitCode |= task_no;
status = rtems_message_queue_send(Q_id, &exitCode, 4);
if (status != RTEMS_SUCCESSFUL) {
printk("[TASK %d] Failed to rtems_message_queue_send, status: %d\n", task_no, status);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment