mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-04-17 11:43:37 +00:00
psasim: remove sleep on server side to make test as fast as possible
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
This commit is contained in:
parent
7cdb1dde60
commit
6271004da9
@ -26,8 +26,6 @@
|
|||||||
#define MAX_CLIENTS 128
|
#define MAX_CLIENTS 128
|
||||||
#define MAX_MESSAGES 32
|
#define MAX_MESSAGES 32
|
||||||
|
|
||||||
#define SLEEP_US 1
|
|
||||||
|
|
||||||
struct connection {
|
struct connection {
|
||||||
uint32_t client;
|
uint32_t client;
|
||||||
void *rhandle;
|
void *rhandle;
|
||||||
@ -104,9 +102,6 @@ psa_signal_t psa_wait(psa_signal_t signal_mask, uint32_t timeout)
|
|||||||
uint32_t requested_version;
|
uint32_t requested_version;
|
||||||
ssize_t len;
|
ssize_t len;
|
||||||
int idx;
|
int idx;
|
||||||
#if !defined(PSASIM_USE_USLEEP)
|
|
||||||
const struct timespec ts_delay = { .tv_sec = 0, .tv_nsec = SLEEP_US * 1000 };
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (timeout == PSA_POLL) {
|
if (timeout == PSA_POLL) {
|
||||||
INFO("psa_wait: Called in polling mode");
|
INFO("psa_wait: Called in polling mode");
|
||||||
@ -261,11 +256,6 @@ psa_signal_t psa_wait(psa_signal_t signal_mask, uint32_t timeout)
|
|||||||
break;
|
break;
|
||||||
} 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)
|
|
||||||
usleep(SLEEP_US);
|
|
||||||
#else /* PSASIM_USE_USLEEP */
|
|
||||||
nanosleep(&ts_delay, NULL);
|
|
||||||
#endif /* PSASIM_USE_USLEEP */
|
|
||||||
}
|
}
|
||||||
} while (timeout == PSA_BLOCK);
|
} while (timeout == PSA_BLOCK);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user