zephyr/tests/benchmarks/app_kernel/src/sema_r.c
Peter Mitsis fa33147bf9 tests: app_kernel: Add user support
Add user thread support to message queue, semaphore, mutex and
pipe tests. Mailbox and memory map tests are restricted from
executing from user threads.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:45 +01:00

30 lines
450 B
C

/* sema_r.c */
/*
* Copyright (c) 1997-2010, 2013-2014 Wind River Systems, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "receiver.h"
#include "master.h"
/* semaphore signal speed test */
/**
* @brief Receive task (Wait task)
*/
void waittask(void)
{
int i;
for (i = 0; i < NR_OF_SEMA_RUNS; i++) {
k_sem_take(&SEM1, K_FOREVER);
}
for (i = 0; i < NR_OF_SEMA_RUNS; i++) {
k_sem_take(&SEM1, K_MSEC(SEMA_WAIT_TIME));
}
}