Skip to content

Commit

Permalink
disallow margo_timer_start when timer is being canceled
Browse files Browse the repository at this point in the history
  • Loading branch information
mdorier committed Apr 11, 2024
1 parent bcf8f16 commit 8bee0a5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/margo-timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,8 @@ int margo_timer_create_with_pool(margo_instance_id mid,

int margo_timer_start(margo_timer_t timer, double timeout_ms)
{
if (timer->prev != NULL || timer->next != NULL) return -1;
if (timer->prev != NULL || timer->next != NULL || timer->canceled)
return -1;

struct margo_timer_list* timer_lst = __margo_get_timer_list(timer->mid);
timer->expiration = ABT_get_wtime() + (timeout_ms / 1000);
Expand Down

0 comments on commit 8bee0a5

Please sign in to comment.