Пример #1
0
static void grpc_timers_log_add(int tag, marker_type type, void* id,
                                const char* file, int line) {
  grpc_timer_entry* entry;

  /* TODO (vpai) : Improve concurrency */
  if (count == MAX_COUNT) {
    log_report();
  }

  entry = &log[count++];

  grpc_precise_clock_now(&entry->tm);
  entry->tag = tag;
  entry->type = type;
  entry->id = id;
  entry->file = file;
  entry->line = line;
}
Пример #2
0
void grpc_timers_log_add(grpc_timers_log* log, const char* tag, int seq,
                         const char* file, int line) {
  grpc_timer_entry* entry;

  /* TODO (vpai) : Improve concurrency */
  gpr_mu_lock(&log->mu);
  if (log->num_entries == log->capacity_limit) {
    log_report_locked(log);
  }

  entry = &log->log[log->num_entries++];

  grpc_precise_clock_now(&entry->tm);
  entry->tag = tag;
  entry->seq = seq;
  entry->file = file;
  entry->line = line;

  gpr_mu_unlock(&log->mu);
}