mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-21 10:01:57 +00:00
lxip: fix timer deletion and modification
Linux del_timer() and mod_timer() return if the timer was pending before the modification. Additionally, these functions are potentially called from handler function of the timer to modify and, therefore, checking for timeout != INVALID_TIMEOUT is not sufficient as the timeout is indeed valid when the handler is executed.
This commit is contained in:
parent
9ff82d76c0
commit
7b9edcf90c
@ -230,7 +230,7 @@ class Lx::Timer
|
|||||||
if (!ctx)
|
if (!ctx)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
int rv = ctx->timeout != Context::INVALID_TIMEOUT ? 1 : 0;
|
int rv = ctx->pending ? 1 : 0;
|
||||||
|
|
||||||
_list.remove(ctx);
|
_list.remove(ctx);
|
||||||
destroy(&_timer_alloc, ctx);
|
destroy(&_timer_alloc, ctx);
|
||||||
@ -253,7 +253,7 @@ class Lx::Timer
|
|||||||
* If timer was already active return 1, otherwise 0. The return
|
* If timer was already active return 1, otherwise 0. The return
|
||||||
* value is needed by mod_timer().
|
* value is needed by mod_timer().
|
||||||
*/
|
*/
|
||||||
int rv = ctx->timeout != Context::INVALID_TIMEOUT ? 1 : 0;
|
int rv = ctx->pending ? 1 : 0;
|
||||||
|
|
||||||
_schedule_timer(ctx, expires);
|
_schedule_timer(ctx, expires);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user