Skip to content

Commit

Permalink
more fix for the margo-eventual test
Browse files Browse the repository at this point in the history
  • Loading branch information
mdorier committed Sep 4, 2023
1 parent b3b88cd commit 0549471
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions tests/unit-tests/margo-eventual.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void waiter_fn(void* _arg)
}

struct ev_queue_element {
margo_eventual_t* ev;
margo_eventual_t ev;
struct ev_queue_element* next;
};

Expand All @@ -73,24 +73,24 @@ ABT_cond ev_queue_cond;

void waiter_sub_fn(void)
{
margo_eventual_t ev;
struct ev_queue_element* q_e;

q_e = malloc(sizeof(*q_e));
munit_assert_not_null(q_e);

MARGO_EVENTUAL_CREATE(&ev);
MARGO_EVENTUAL_CREATE(&q_e->ev);

ABT_mutex_lock(ev_queue_mutex);
q_e->ev = &ev;
q_e->next = ev_queue_head;
ev_queue_head = q_e;
ABT_cond_signal(ev_queue_cond);
ABT_mutex_unlock(ev_queue_mutex);

MARGO_EVENTUAL_WAIT(ev);
MARGO_EVENTUAL_WAIT(q_e->ev);

MARGO_EVENTUAL_FREE(&q_e->ev);

MARGO_EVENTUAL_FREE(&ev);
free(q_e);

return;
}
Expand Down Expand Up @@ -141,8 +141,7 @@ static MunitResult margo_eventual_iteration(const MunitParameter params[],
ev_queue_head = q_e->next;
ABT_mutex_unlock(ev_queue_mutex);

MARGO_EVENTUAL_SET(*q_e->ev);
free(q_e);
MARGO_EVENTUAL_SET(q_e->ev);
}

for (i = 0; i < N_ULTS; i++) { ABT_thread_join(tid_array[i]); }
Expand Down

0 comments on commit 0549471

Please sign in to comment.