Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Unified Diff: third_party/grpc/src/core/iomgr/pollset_set.h

Issue 1932353002: Initial checkin of gRPC to third_party/ Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/grpc/src/core/iomgr/pollset_set.h
diff --git a/third_party/tcmalloc/vendor/src/base/spinlock_internal.h b/third_party/grpc/src/core/iomgr/pollset_set.h
similarity index 52%
copy from third_party/tcmalloc/vendor/src/base/spinlock_internal.h
copy to third_party/grpc/src/core/iomgr/pollset_set.h
index 44942609f40a87492a7aeed0068a5e27bf9cd157..dddcd8313f220a63ba0c934b69f2fd53b1026e33 100644
--- a/third_party/tcmalloc/vendor/src/base/spinlock_internal.h
+++ b/third_party/grpc/src/core/iomgr/pollset_set.h
@@ -1,4 +1,6 @@
-/* Copyright (c) 2010, Google Inc.
+/*
+ *
+ * Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -27,38 +29,33 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * ---
- * This file is an internal part spinlock.cc and once.cc
- * It may not be used directly by code outside of //base.
*/
-#ifndef BASE_SPINLOCK_INTERNAL_H_
-#define BASE_SPINLOCK_INTERNAL_H_
+#ifndef GRPC_INTERNAL_CORE_IOMGR_POLLSET_SET_H
+#define GRPC_INTERNAL_CORE_IOMGR_POLLSET_SET_H
-#include <config.h>
-#include "base/basictypes.h"
-#include "base/atomicops.h"
+#include "src/core/iomgr/pollset.h"
-namespace base {
-namespace internal {
+/* A grpc_pollset_set is a set of pollsets that are interested in an
+ action. Adding a pollset to a pollset_set automatically adds any
+ fd's (etc) that have been registered with the set_set to that pollset.
+ Registering fd's automatically adds them to all current pollsets. */
-// SpinLockWait() waits until it can perform one of several transitions from
-// "from" to "to". It returns when it performs a transition where done==true.
-struct SpinLockWaitTransition {
- int32 from;
- int32 to;
- bool done;
-};
+typedef struct grpc_pollset_set grpc_pollset_set;
-// Wait until *w can transition from trans[i].from to trans[i].to for some i
-// satisfying 0<=i<n && trans[i].done, atomically make the transition,
-// then return the old value of *w. Make any other atomic tranistions
-// where !trans[i].done, but continue waiting.
-int32 SpinLockWait(volatile Atomic32 *w, int n,
- const SpinLockWaitTransition trans[]);
-void SpinLockWake(volatile Atomic32 *w, bool all);
-void SpinLockDelay(volatile Atomic32 *w, int32 value, int loop);
+grpc_pollset_set *grpc_pollset_set_create(void);
+void grpc_pollset_set_destroy(grpc_pollset_set *pollset_set);
+void grpc_pollset_set_add_pollset(grpc_exec_ctx *exec_ctx,
+ grpc_pollset_set *pollset_set,
+ grpc_pollset *pollset);
+void grpc_pollset_set_del_pollset(grpc_exec_ctx *exec_ctx,
+ grpc_pollset_set *pollset_set,
+ grpc_pollset *pollset);
+void grpc_pollset_set_add_pollset_set(grpc_exec_ctx *exec_ctx,
+ grpc_pollset_set *bag,
+ grpc_pollset_set *item);
+void grpc_pollset_set_del_pollset_set(grpc_exec_ctx *exec_ctx,
+ grpc_pollset_set *bag,
+ grpc_pollset_set *item);
-} // namespace internal
-} // namespace base
-#endif
+#endif /* GRPC_INTERNAL_CORE_IOMGR_POLLSET_H */
« no previous file with comments | « third_party/grpc/src/core/iomgr/pollset_posix.c ('k') | third_party/grpc/src/core/iomgr/pollset_set_posix.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698