mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
Adds a way to cancel a blocking rpc call (#94)
This commit is contained in:
committed by
Peter Johnson
parent
d6e8de21ef
commit
c0ce4270f0
@@ -1446,3 +1446,10 @@ bool Storage::GetRpcResult(bool blocking, unsigned int call_uid, double time_out
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
void Storage::CancelBlockingRpcResult(unsigned int call_uid) {
|
||||
std::unique_lock<std::mutex> lock(m_mutex);
|
||||
// safe to erase even if id does not exist
|
||||
m_rpc_blocking_calls.erase(call_uid);
|
||||
m_rpc_results_cond.notify_all();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user