chromium/third_party/grpc/src/src/core/lib/iomgr/combiner.cc

//
//
// Copyright 2016 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
//

#include <grpc/support/port_platform.h>

#include "src/core/lib/iomgr/combiner.h"

#include <assert.h>
#include <inttypes.h>
#include <string.h>

#include <grpc/support/alloc.h>
#include <grpc/support/log.h>

#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/mpscq.h"
#include "src/core/lib/iomgr/executor.h"
#include "src/core/lib/iomgr/iomgr_internal.h"

grpc_core::DebugOnlyTraceFlag grpc_combiner_trace(false, "combiner");

#define GRPC_COMBINER_TRACE(fn)

#define STATE_UNORPHANED
#define STATE_ELEM_COUNT_LOW_BIT

static void combiner_exec(grpc_core::Combiner* lock, grpc_closure* closure,
                          grpc_error_handle error);
static void combiner_finally_exec(grpc_core::Combiner* lock,
                                  grpc_closure* closure,
                                  grpc_error_handle error);

static void offload(void* arg, grpc_error_handle error);

grpc_core::Combiner* grpc_combiner_create(void) {}

static void really_destroy(grpc_core::Combiner* lock) {}

static void start_destroy(grpc_core::Combiner* lock) {}

#ifndef NDEBUG
#define GRPC_COMBINER_DEBUG_SPAM(op, delta)
#else
#define GRPC_COMBINER_DEBUG_SPAM
#endif

void grpc_combiner_unref(grpc_core::Combiner* lock GRPC_COMBINER_DEBUG_ARGS) {}

grpc_core::Combiner* grpc_combiner_ref(
    grpc_core::Combiner* lock GRPC_COMBINER_DEBUG_ARGS) {}

static void push_last_on_exec_ctx(grpc_core::Combiner* lock) {}

static void push_first_on_exec_ctx(grpc_core::Combiner* lock) {}

static void combiner_exec(grpc_core::Combiner* lock, grpc_closure* cl,
                          grpc_error_handle error) {}

static void move_next() {}

static void offload(void* arg, grpc_error_handle /*error*/) {}

static void queue_offload(grpc_core::Combiner* lock) {}

bool grpc_combiner_continue_exec_ctx() {}

static void enqueue_finally(void* closure, grpc_error_handle error);

static void combiner_finally_exec(grpc_core::Combiner* lock,
                                  grpc_closure* closure,
                                  grpc_error_handle error) {}

static void enqueue_finally(void* closure, grpc_error_handle error) {}

namespace grpc_core {
void Combiner::Run(grpc_closure* closure, grpc_error_handle error) {}

void Combiner::FinallyRun(grpc_closure* closure, grpc_error_handle error) {}
}  // namespace grpc_core