mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-04-16 08:42:50 +00:00
psa_sim: make server ping time much faster
Reduce server's ping time for messages from 50ms to 1us because otherwise tests suites will take forever to execute. Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
This commit is contained in:
parent
7c52100fbd
commit
2687e4797d
@ -26,7 +26,7 @@
|
|||||||
#define MAX_CLIENTS 128
|
#define MAX_CLIENTS 128
|
||||||
#define MAX_MESSAGES 32
|
#define MAX_MESSAGES 32
|
||||||
|
|
||||||
#define SLEEP_MS 50
|
#define SLEEP_US 1
|
||||||
|
|
||||||
struct connection {
|
struct connection {
|
||||||
uint32_t client;
|
uint32_t client;
|
||||||
@ -105,7 +105,7 @@ psa_signal_t psa_wait(psa_signal_t signal_mask, uint32_t timeout)
|
|||||||
ssize_t len;
|
ssize_t len;
|
||||||
int idx;
|
int idx;
|
||||||
#if !defined(PSASIM_USE_USLEEP)
|
#if !defined(PSASIM_USE_USLEEP)
|
||||||
const struct timespec ts_delay = { .tv_sec = 0, .tv_nsec = SLEEP_MS * 1000000 };
|
const struct timespec ts_delay = { .tv_sec = 0, .tv_nsec = SLEEP_US * 1000 };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (timeout == PSA_POLL) {
|
if (timeout == PSA_POLL) {
|
||||||
@ -262,7 +262,7 @@ psa_signal_t psa_wait(psa_signal_t signal_mask, uint32_t timeout)
|
|||||||
} else {
|
} else {
|
||||||
/* There is no 'select' function in SysV to block on multiple queues, so busy-wait :( */
|
/* There is no 'select' function in SysV to block on multiple queues, so busy-wait :( */
|
||||||
#if defined(PSASIM_USE_USLEEP)
|
#if defined(PSASIM_USE_USLEEP)
|
||||||
usleep(SLEEP_MS * 1000);
|
usleep(SLEEP_US);
|
||||||
#else /* PSASIM_USE_USLEEP */
|
#else /* PSASIM_USE_USLEEP */
|
||||||
nanosleep(&ts_delay, NULL);
|
nanosleep(&ts_delay, NULL);
|
||||||
#endif /* PSASIM_USE_USLEEP */
|
#endif /* PSASIM_USE_USLEEP */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user