Commit 324e0ae4 authored by Andreas Schmidt's avatar Andreas Schmidt

Reduce to 1ms.

parent a3820cf8
Pipeline #2805 passed with stages
in 1 minute and 42 seconds
......@@ -322,7 +322,7 @@ int32_t PrrtSocket_receive_asap_wait(PrrtSocket *s, void *buf_ptr, struct sockad
PrrtPace_track_start(s->appDeliverPace);
PrrtPacket *packet;
do {
struct timespec deadline = abstime_from_now(30 * 1000);
struct timespec deadline = abstime_from_now(1 * 1000);
packet = PrrtPacketDeliveryStore_get_packet_timedwait(s->packetDeliveryStore, 0, MAX_TIMESTAMP, &deadline);
if (packet == NULL && errno == ETIMEDOUT) {
errno = 0;
......
......@@ -7,16 +7,6 @@
#include "../../util/time.h"
#include "packetDeliveryStore.h"
int packet_wait(PrrtPacketDeliveryStore *store, prrtTimestamp_t start, prrtTimestamp_t stop, const struct timespec *deadline) {
store->last_start = start;
store->last_stop = stop;
store->in_ordered_wait = true;
int result = pthread_cond_timedwait(&store->wait_for_data, &store->lock, deadline);
debug(DEBUG_RECEIVER, "After wait: %d", result);
store->in_ordered_wait = false;
return result;
}
PrrtPacketDeliveryStore *PrrtPacketDeliveryStore_create() {
PrrtPacketDeliveryStore *store = (PrrtPacketDeliveryStore *) calloc(1, sizeof(PrrtPacketDeliveryStore));
store->tree = NULL;
......@@ -77,7 +67,12 @@ PrrtPacket * PrrtPacketDeliveryStore_get_packet_timedwait(PrrtPacketDeliveryStor
do {
packet = PrrtPacketDeliveryStore_get_packet(store, start, stop);
if (packet == NULL) {
int res = packet_wait(store, start, stop, deadline);
store->last_start = start;
store->last_stop = stop;
store->in_ordered_wait = true;
int res = pthread_cond_timedwait(&store->wait_for_data, &store->lock, deadline);
debug(DEBUG_RECEIVER, "After wait: %d", res);
store->in_ordered_wait = false;
packet = PrrtPacketDeliveryStore_get_packet(store, start, stop);
if (packet == NULL && res == ETIMEDOUT) {
errno = ETIMEDOUT;
......
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