Skip to content

Commit

Permalink
Implement timeout in util_wait_yield_run()
Browse files Browse the repository at this point in the history
Signed-off-by: Franz Pöschel <franz.poeschel@gmail.com>
  • Loading branch information
franzpoeschel authored and j-xiong committed Dec 16, 2023
1 parent c8c03b7 commit 22c9d04
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions prov/util/src/util_wait.c
Original file line number Diff line number Diff line change
Expand Up @@ -593,10 +593,15 @@ static int util_wait_yield_run(struct fid_wait *wait_fid, int timeout)
{
struct util_wait_yield *wait;
struct ofi_wait_fid_entry *fid_entry;
uint64_t endtime;
int ret = 0;

wait = container_of(wait_fid, struct util_wait_yield, util_wait.wait_fid);
endtime = ofi_timeout_time(timeout);

while (!wait->signal) {
if (ofi_adjust_timeout(endtime, &timeout))
return -FI_ETIMEDOUT;
ofi_mutex_lock(&wait->util_wait.lock);
dlist_foreach_container(&wait->util_wait.fid_list,
struct ofi_wait_fid_entry,
Expand Down

0 comments on commit 22c9d04

Please sign in to comment.