]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/base/AsyncCallQueue.cc
2 * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
9 /* DEBUG: section 41 Event Processing */
12 #include "base/AsyncCall.h"
13 #include "base/AsyncCallQueue.h"
14 #include "debug/Stream.h"
16 AsyncCallQueue
*AsyncCallQueue::TheInstance
= nullptr;
18 // Fire all scheduled calls; returns true if at least one call was fired.
19 // The calls may be added while the current call is in progress.
21 AsyncCallQueue::fire()
23 const auto made
= scheduled
.size() > 0;
24 while (const auto call
= scheduled
.extract()) {
25 CodeContext::Reset(call
->codeContext
);
26 debugs(call
->debugSection
, call
->debugLevel
, "entering " << *call
);
28 debugs(call
->debugSection
, call
->debugLevel
, "leaving " << *call
);
36 AsyncCallQueue::Instance()
38 // TODO: how to remove this frequent check while supporting early calls?
40 TheInstance
= new AsyncCallQueue();