19 ReturnedHintArr DetectorAlignStore::TrackingAlignStore::s_returnedHints{};
25 std::lock_guard guard{s_ticketMutex};
26 const unsigned int idx =
static_cast<unsigned>(
type);
27 std::vector<bool>& returnedPool = s_returnedTickets[
idx];
28 int& returnedHint = s_returnedHints[
idx];
29 if (returnedPool.size() && returnedHint >= 0) {
30 for (
size_t i = returnedHint;
i < returnedPool.size();
i++) {
31 if (returnedPool[
i]) {
32 returnedPool[
i] =
false;
35 if (
static_cast<size_t>(returnedHint) >= returnedPool.size()) {
42 for (
size_t i = 0; i < static_cast<size_t>(returnedHint);
i++) {
43 if (returnedPool[
i]) {
44 returnedPool[
i] =
false;
55 return s_clientCounter[
idx]++;
58 return s_clientCounter[
static_cast<unsigned int>(
type)];
61 std::lock_guard guard{s_ticketMutex};
62 const unsigned int idx =
static_cast<unsigned int>(
type);
63 std::vector<bool>& returnedPool = s_returnedTickets[
idx];
64 int& returnedHint = s_returnedHints[
idx];
66 if (ticketNo == distributedTickets(
type) -1) {
68 if (ticketNo > 0 && ticketNo-1 < returnedPool.size()) {
69 for (; ticketNo > 0 && returnedPool[ticketNo-1]; --ticketNo)
71 returnedPool.resize (ticketNo);
74 s_clientCounter[
idx] = ticketNo;
75 if (returnedHint >=
static_cast<int>(ticketNo)) {
79 if (returnedPool.size() <= ticketNo) {
80 returnedPool.resize (ticketNo+1);
82 returnedPool[ticketNo] =
true;
83 if (returnedHint < 0 ||
static_cast<int>(ticketNo) < returnedHint) {
84 returnedHint = ticketNo;