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 Poeschel <f.poeschel@hzdr.de>
  • Loading branch information
franzpoeschel committed Dec 15, 2023
1 parent b396355 commit 4d369af
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 4d369af

Please sign in to comment.