Skip to content

Commit

Permalink
AP_HAL: fixed CondMutex test
Browse files Browse the repository at this point in the history
  • Loading branch information
tridge committed Aug 6, 2024
1 parent 1f248b4 commit 87a1ad2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions libraries/AP_HAL/examples/CondMutex/CondMutex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,12 @@ void ProducerConsumerTest::thread2(void)
}
cmtx.unlock();
#else
bool ok = sem1.wait(50000);
update(ok);
sem1.wait_blocking();
while (bsize>0) {
update(true);
}
#endif
hal.scheduler->delay_microseconds(get_random());
hal.scheduler->delay_microseconds(get_random()+1);
}
}

Expand All @@ -78,7 +80,7 @@ void ProducerConsumerTest::thread1(void)
sem1.signal();
update_sent();
#endif
hal.scheduler->delay_microseconds(get_random());
hal.scheduler->delay_microseconds(get_random()+1);
}
}

Expand Down

0 comments on commit 87a1ad2

Please sign in to comment.