Merge pull request #24886 from grpc/vjpai-patch-3

Document that spinlock holder may not block
pull/24891/head
Vijay Pai 4 years ago committed by GitHub
commit 5ab59b2bf7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      src/core/lib/gpr/spinlock.h

@ -23,8 +23,9 @@
#include <grpc/support/atm.h>
/* Simple spinlock. No backoff strategy, gpr_spinlock_lock is almost always
a concurrency code smell. */
// Simple spinlock. No backoff strategy, gpr_spinlock_lock is almost always
// a concurrency code smell. Code must _never_ block while holding a spinlock
// as this could lead to a deadlock under a cooperative multithreading model.
struct gpr_spinlock {
gpr_atm atm;
};

Loading…
Cancel
Save