Go to the documentation of this file.
63 return static_cast<uint32_t>(ref_pair >> 48);
66 return static_cast<uint64_t>(ref_pair & 0xffffffffffff
u);
78 gpr_log(
GPR_INFO,
"WorkSerializer::Run() %p Scheduling callback [%s:%d]",
79 this, location.
file(), location.
line());
113 "WorkSerializer::Schedule() %p Scheduling callback %p [%s:%d]",
114 this, cb_wrapper, location.
file(), location.
line());
116 refs_.fetch_add(MakeRefPair(0, 1), std::memory_order_acq_rel);
125 refs_.fetch_sub(MakeRefPair(0, 1), std::memory_order_acq_rel);
126 if (GetOwners(prev_ref_pair) == 0 && GetSize(prev_ref_pair) == 1) {
143 refs_.fetch_add(MakeRefPair(1, 1), std::memory_order_acq_rel);
144 if (GetOwners(prev_ref_pair) == 0) {
150 refs_.fetch_sub(MakeRefPair(1, 0), std::memory_order_acq_rel);
161 auto prev_ref_pair = refs_.fetch_sub(MakeRefPair(0, 1));
164 if (GetSize(prev_ref_pair) == 1) {
171 if (GetSize(prev_ref_pair) == 2) {
173 uint64_t expected = MakeRefPair(1, 1);
174 if (refs_.compare_exchange_strong(expected, MakeRefPair(0, 1),
175 std::memory_order_acq_rel)) {
179 if (GetSize(expected) == 0) {
193 queue_.PopAndCheckEnd(&empty_unused))) ==
nullptr) {
static uint64_t GetSize(uint64_t ref_pair)
#define GPR_DEBUG_ASSERT(x)
OPENSSL_EXPORT X509_EXTENSION int loc
OPENSSL_EXPORT pem_password_cb void * u
void Run(std::function< void()> callback, const DebugLocation &location)
DebugOnlyTraceFlag grpc_work_serializer_trace(false, "work_serializer")
const DebugLocation location
const char * file() const
static uint32_t GetOwners(uint64_t ref_pair)
#define GRPC_TRACE_FLAG_ENABLED(f)
void Schedule(std::function< void()> callback, const DebugLocation &location)
static uint64_t MakeRefPair(uint16_t owners, uint64_t size)
const std::function< void()> callback
constexpr absl::remove_reference_t< T > && move(T &&t) noexcept
GPRAPI void gpr_log(const char *file, int line, gpr_log_severity severity, const char *format,...) GPR_PRINT_FORMAT_CHECK(4
unsigned __int64 uint64_t
OrphanablePtr< WorkSerializerImpl > impl_
static void callback(void *arg, int status, int timeouts, struct hostent *host)
MultiProducerSingleConsumerQueue::Node mpscq_node
void Run(std::function< void()> callback, const DebugLocation &location)
OrphanablePtr< T > MakeOrphanable(Args &&... args)
std::atomic< uint64_t > refs_
MultiProducerSingleConsumerQueue queue_
CallbackWrapper(std::function< void()> cb, const DebugLocation &loc)
TraceFlag DebugOnlyTraceFlag
void Schedule(std::function< void()> callback, const DebugLocation &location)
OPENSSL_EXPORT pem_password_cb * cb
grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:01:52