aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2017-02-27 07:27:07 -0800
committerGravatar Craig Tiller <ctiller@google.com>2017-02-27 07:27:07 -0800
commitc758542df614481b9c33a331dd993b42e7e4f643 (patch)
tree714a97e34b5990b75ae26ae8a7b2a9e94991a4e6 /src
parentedbf2b9d13445221c9d8858c00cea02435570fe0 (diff)
Fix compile
Diffstat (limited to 'src')
-rw-r--r--src/core/lib/iomgr/timer_generic.c2
-rw-r--r--src/core/lib/support/spinlock.h2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/core/lib/iomgr/timer_generic.c b/src/core/lib/iomgr/timer_generic.c
index 09ff2d0c3c..d4df96c214 100644
--- a/src/core/lib/iomgr/timer_generic.c
+++ b/src/core/lib/iomgr/timer_generic.c
@@ -70,7 +70,7 @@ typedef struct {
/* Protects g_shard_queue */
static gpr_mu g_mu;
/* Allow only one run_some_expired_timers at once */
-static gpr_spinlock g_checker_mu = GPR_SPINLOCK_INITIALIZER;
+static gpr_spinlock g_checker_mu = GPR_SPINLOCK_STATIC_INITIALIZER;
static gpr_clock_type g_clock_type;
static shard_type g_shards[NUM_SHARDS];
/* Protected by g_mu */
diff --git a/src/core/lib/support/spinlock.h b/src/core/lib/support/spinlock.h
index aeb5622726..06c45de84b 100644
--- a/src/core/lib/support/spinlock.h
+++ b/src/core/lib/support/spinlock.h
@@ -41,6 +41,8 @@
typedef struct { gpr_atm atm; } gpr_spinlock;
#define GPR_SPINLOCK_INITIALIZER ((gpr_spinlock){0})
+#define GPR_SPINLOCK_STATIC_INITIALIZER \
+ { 0 }
#define gpr_spinlock_trylock(lock) (gpr_atm_acq_cas(&(lock)->atm, 0, 1))
#define gpr_spinlock_unlock(lock) (gpr_atm_rel_store(&(lock)->atm, 0))
#define gpr_spinlock_lock(lock) \