Skip to content

Commit

Permalink
Merge pull request #67 from freidt/master
Browse files Browse the repository at this point in the history
Bug fix for adding timeout to the implicit locking for SWT and SCA
  • Loading branch information
sy-c authored Dec 14, 2023
2 parents dfc9829 + 43f4bf0 commit b5a46a7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/AlfServer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,14 @@ std::string AlfServer::scaBlobWrite(const std::string& parameter, AlfLink link)
Sca sca = Sca(link, mSessions[link.serialId]);

bool lock = false;
int lockTimeout = 0;
// Check if the operation should be locked
if (scaPairs[0].first == Sca::Operation::Lock) {
lockTimeout = boost::get<int>(scaPairs[0].second);
scaPairs.erase(scaPairs.begin());
lock = true;
}
return sca.writeSequence(scaPairs, lock);
return sca.writeSequence(scaPairs, lock, lockTimeout);
}

std::string AlfServer::scaMftPsuBlobWrite(const std::string& parameter, AlfLink link)
Expand All @@ -105,12 +107,14 @@ std::string AlfServer::swtBlobWrite(const std::string& parameter, AlfLink link)
Swt swt = Swt(link, mSessions[link.serialId], mSwtWordSize);

bool lock = false;
int lockTimeout = 0;
// Check if the operation should be locked
if (swtPairs[0].first == Swt::Operation::Lock) {
swtPairs.erase(swtPairs.begin());
lockTimeout = boost::get<int>(swtPairs[0].second);
lock = true;
swtPairs.erase(swtPairs.begin());
}
return swt.writeSequence(swtPairs, lock);
return swt.writeSequence(swtPairs, lock, lockTimeout);
}

std::string AlfServer::icBlobWrite(const std::string& parameter, AlfLink link)
Expand Down

0 comments on commit b5a46a7

Please sign in to comment.