Skip to content

Commit

Permalink
Merge pull request #17 from pshved/ros2_0_galactic
Browse files Browse the repository at this point in the history
Remove the call to isAlive() which is broken
  • Loading branch information
jpazhaya authored Apr 6, 2024
2 parents 98d11bb + 706ea91 commit 6a35755
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions lib/xspublic/xscommon/threading.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -383,10 +383,21 @@ void StandardThread::stopThread(void) noexcept
// return;
// }
//#else
while (isAlive())
xsYield();
int rv = 0;
while (true) {
rv = pthread_tryjoin_np(m_thread, NULL);
if (rv == 0) {
break;
}
if (errno == EBUSY) {
xsYield();
} else {
// Some other error--maybe the thread is invalid?
break;
}
}
//#endif
if (pthread_join(m_thread, NULL))
if (rv != 0)
{
switch (errno)
{
Expand Down

0 comments on commit 6a35755

Please sign in to comment.