Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LARN
PRRT
Commits
e73683dc
Commit
e73683dc
authored
Dec 05, 2019
by
Marlene Böhmer
Browse files
check timeout on delivery
parent
3063e8bc
Pipeline
#4333
failed with stages
in 27667 minutes and 16 seconds
Changes
1
Pipelines
4
Show whitespace changes
Inline
Side-by-side
prrt/proto/stores/packetDeliveryStore.c
View file @
e73683dc
...
...
@@ -99,8 +99,11 @@ PrrtPacket *PrrtPacketDeliveryStore_get_packet_timedwait(PrrtPacketDeliveryStore
PrrtPacket
*
PrrtPacketDeliveryStore_get_packet
(
PrrtPacketDeliveryStore
*
store
,
prrtTimestamp_t
start
,
prrtTimestamp_t
stop
)
{
PrrtPacket
*
packet
=
NULL
;
bool
timed_out
;
check
(
pthread_mutex_lock
(
&
store
->
lock
)
==
EXIT_SUCCESS
,
"Lock failed."
);
do
{
timed_out
=
false
;
if
(
start
>
stop
)
{
packet
=
BPTree_get_first_in_range
(
store
->
tree
,
(
BPTreeKey_t
)
start
,
TIMESTAMP_SPACE
-
1
);
...
...
@@ -113,8 +116,15 @@ PrrtPacket *PrrtPacketDeliveryStore_get_packet(PrrtPacketDeliveryStore *store, p
if
(
packet
!=
NULL
)
{
store
->
tree
=
BPTree_delete
(
store
->
tree
,
PrrtDataPacket_packet_timeout
(
packet
));
prrtTimestamp_t
now
=
PrrtClock_get_current_time_us
();
if
(
PrrtTimestamp_cmp
(
now
,
PrrtDataPacket_packet_timeout
(
packet
))
>
0
)
{
timed_out
=
true
;
PrrtPacket_destroy
(
packet
);
packet
=
NULL
;
}
}
}
while
(
timed_out
);
check
(
pthread_mutex_unlock
(
&
store
->
lock
)
==
EXIT_SUCCESS
,
"Unlock failed."
);
return
packet
;
...
...
Andreas Schmidt
@as
mentioned in issue
#41 (closed)
·
Jan 14, 2020
mentioned in issue
#41 (closed)
mentioned in issue #41
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment