mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
getactorstats query for validator-engine-console
This commit is contained in:
parent
e55c132178
commit
420029b056
39 changed files with 1223 additions and 51 deletions
|
@ -115,6 +115,22 @@ class StealingQueue {
|
|||
std::atomic_thread_fence(std::memory_order_seq_cst);
|
||||
}
|
||||
|
||||
size_t size() const {
|
||||
while (true) {
|
||||
auto head = head_.load();
|
||||
auto tail = tail_.load(std::memory_order_acquire);
|
||||
|
||||
if (tail < head) {
|
||||
continue;
|
||||
}
|
||||
size_t n = tail - head;
|
||||
if (n > N) {
|
||||
continue;
|
||||
}
|
||||
return n;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
std::atomic<td::int64> head_{0};
|
||||
std::atomic<td::int64> tail_{0};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue