Skip to content

Commit

Permalink
DeviceGeneric.cpp: If the previous call failed, allow more time to se…
Browse files Browse the repository at this point in the history
…ttle.

Failure means that the buffer was not yet destroyed, so the next call will
probably fail as well if we don't delay the process.

Signed-off-by: AlexandraTrifan <[email protected]>
  • Loading branch information
AlexandraTrifan authored and Adrian-Stanea committed Dec 11, 2023
1 parent 656f2de commit ab0bd71
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/utils/devicegeneric.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <cstring>
#include <sstream>
#include <iterator>
#include <thread>

using namespace std;
using namespace libm2k::utils;
Expand Down Expand Up @@ -644,6 +645,9 @@ void DeviceGeneric::setKernelBuffersCount(unsigned int count)
retry++;
if (ret != -EBUSY) {
ok = true;
} else {
// If the call failed, allow more time to settle
std::this_thread::sleep_for(std::chrono::milliseconds(5));
}
}
if (ret != 0) {
Expand Down

0 comments on commit ab0bd71

Please sign in to comment.