clang-format

pull/6407/head
Craig Tiller 9 years ago
parent ad3c8c1a5d
commit e49429587b
  1. 2
      include/grpc/impl/codegen/atm_win32.h
  2. 2
      src/core/lib/iomgr/async_execution_lock.c
  3. 2
      src/core/lib/iomgr/async_execution_lock.h
  4. 8
      src/core/lib/support/mpscq.c
  5. 6
      src/core/lib/support/mpscq.h

@ -123,7 +123,7 @@ static __inline gpr_atm gpr_atm_full_fetch_add(gpr_atm *p, gpr_atm delta) {
}
static __inline gpr_atm gpr_atm_full_xchg(gpr_atm *p, gpr_atm n) {
return (gpr_atm)InterlockedExchangePointer((PVOID*)p, (PVOID)n);
return (gpr_atm)InterlockedExchangePointer((PVOID *)p, (PVOID)n);
}
#endif /* GRPC_IMPL_CODEGEN_ATM_WIN32_H */

@ -57,7 +57,7 @@ static void finish(grpc_exec_ctx *exec_ctx, grpc_aelock *lock) {
while ((n = gpr_mpscq_pop(&lock->queue)) == NULL) {
// TODO(ctiller): find something to fill in the time
}
grpc_aelock_qnode *ln = (grpc_aelock_qnode*)n;
grpc_aelock_qnode *ln = (grpc_aelock_qnode *)n;
ln->action(exec_ctx, ln->arg);
gpr_free(ln);
}

@ -37,8 +37,8 @@
#include <stddef.h>
#include <grpc/support/atm.h>
#include "src/core/lib/support/mpscq.h"
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/support/mpscq.h"
typedef void (*grpc_aelock_action)(grpc_exec_ctx *exec_ctx, void *arg);

@ -48,13 +48,14 @@ void gpr_mpscq_destroy(gpr_mpscq *q) {
void gpr_mpscq_push(gpr_mpscq *q, gpr_mpscq_node *n) {
gpr_atm_no_barrier_store(&n->next, 0);
gpr_mpscq_node *prev = (gpr_mpscq_node*)gpr_atm_full_xchg(&q->head, (gpr_atm)n);
gpr_mpscq_node *prev =
(gpr_mpscq_node *)gpr_atm_full_xchg(&q->head, (gpr_atm)n);
gpr_atm_rel_store(&prev->next, (gpr_atm)n);
}
gpr_mpscq_node *gpr_mpscq_pop(gpr_mpscq *q) {
gpr_mpscq_node *tail = q->tail;
gpr_mpscq_node *next = (gpr_mpscq_node*)gpr_atm_acq_load(&tail->next);
gpr_mpscq_node *next = (gpr_mpscq_node *)gpr_atm_acq_load(&tail->next);
if (tail == &q->stub) {
if (next == NULL) return NULL;
q->tail = next;
@ -65,7 +66,7 @@ gpr_mpscq_node *gpr_mpscq_pop(gpr_mpscq *q) {
q->tail = next;
return tail;
}
gpr_mpscq_node *head = (gpr_mpscq_node*)gpr_atm_acq_load(&q->head);
gpr_mpscq_node *head = (gpr_mpscq_node *)gpr_atm_acq_load(&q->head);
if (tail != head) {
return 0;
}
@ -77,4 +78,3 @@ gpr_mpscq_node *gpr_mpscq_pop(gpr_mpscq *q) {
}
return NULL;
}

@ -34,12 +34,10 @@
#ifndef GRPC_CORE_LIB_SUPPORT_MPSCQ_H
#define GRPC_CORE_LIB_SUPPORT_MPSCQ_H
#include <stddef.h>
#include <grpc/support/atm.h>
#include <stddef.h>
typedef struct gpr_mpscq_node {
gpr_atm next;
} gpr_mpscq_node;
typedef struct gpr_mpscq_node { gpr_atm next; } gpr_mpscq_node;
typedef struct gpr_mpscq {
gpr_atm head;

Loading…
Cancel
Save