aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Nicolas Noble <nicolasnoble@users.noreply.github.com>2017-07-13 13:39:58 -0700
committerGravatar GitHub <noreply@github.com>2017-07-13 13:39:58 -0700
commit9877189e455bbd4e86420dd586c951debbd1a97e (patch)
tree8ebe543578317099398b5ceecd505bbd427cbe5f /src
parente5b847cea428b237ba612c394dff2bf6f4c5d6f5 (diff)
parent61f21d91b8fb62e402bbd2e32dcd27b9548425a4 (diff)
Merge pull request #11310 from nicolasnoble/import
Import mutations.
Diffstat (limited to 'src')
-rw-r--r--src/core/lib/iomgr/timer_manager.c14
-rw-r--r--src/proto/grpc/health/v1/BUILD8
-rw-r--r--src/proto/grpc/lb/v1/BUILD8
-rw-r--r--src/proto/grpc/reflection/v1alpha/BUILD8
-rw-r--r--src/proto/grpc/status/BUILD10
-rw-r--r--src/proto/grpc/testing/BUILD8
-rw-r--r--src/proto/grpc/testing/duplicate/BUILD8
-rw-r--r--src/python/grpcio/grpc/_cython/_cygrpc/security.pyx.pxi6
8 files changed, 52 insertions, 18 deletions
diff --git a/src/core/lib/iomgr/timer_manager.c b/src/core/lib/iomgr/timer_manager.c
index cb7998db97..b9bea9a2ab 100644
--- a/src/core/lib/iomgr/timer_manager.c
+++ b/src/core/lib/iomgr/timer_manager.c
@@ -56,7 +56,7 @@ static gpr_timespec g_timed_waiter_deadline;
// generation counter to track which thread is waiting for the next timer
static uint64_t g_timed_waiter_generation;
-static void timer_thread(void *unused);
+static void timer_thread(void *completed_thread_ptr);
static void gc_completed_threads(void) {
if (g_completed_threads != NULL) {
@@ -81,10 +81,10 @@ static void start_timer_thread_and_unlock(void) {
if (GRPC_TRACER_ON(grpc_timer_check_trace)) {
gpr_log(GPR_DEBUG, "Spawn timer thread");
}
- gpr_thd_id thd;
gpr_thd_options opt = gpr_thd_options_default();
gpr_thd_options_set_joinable(&opt);
- gpr_thd_new(&thd, timer_thread, NULL, &opt);
+ completed_thread *ct = gpr_malloc(sizeof(*ct));
+ gpr_thd_new(&ct->t, timer_thread, ct, &opt);
}
void grpc_timer_manager_tick() {
@@ -245,7 +245,7 @@ static void timer_main_loop(grpc_exec_ctx *exec_ctx) {
}
}
-static void timer_thread_cleanup(void) {
+static void timer_thread_cleanup(completed_thread *ct) {
gpr_mu_lock(&g_mu);
// terminate the thread: drop the waiter count, thread count, and let whomever
// stopped the threading stuff know that we're done
@@ -254,8 +254,6 @@ static void timer_thread_cleanup(void) {
if (0 == g_thread_count) {
gpr_cv_signal(&g_cv_shutdown);
}
- completed_thread *ct = gpr_malloc(sizeof(*ct));
- ct->t = gpr_thd_currentid();
ct->next = g_completed_threads;
g_completed_threads = ct;
gpr_mu_unlock(&g_mu);
@@ -264,14 +262,14 @@ static void timer_thread_cleanup(void) {
}
}
-static void timer_thread(void *unused) {
+static void timer_thread(void *completed_thread_ptr) {
// this threads exec_ctx: we try to run things through to completion here
// since it's easy to spin up new threads
grpc_exec_ctx exec_ctx =
GRPC_EXEC_CTX_INITIALIZER(0, grpc_never_ready_to_finish, NULL);
timer_main_loop(&exec_ctx);
grpc_exec_ctx_finish(&exec_ctx);
- timer_thread_cleanup();
+ timer_thread_cleanup(completed_thread_ptr);
}
static void start_threads(void) {
diff --git a/src/proto/grpc/health/v1/BUILD b/src/proto/grpc/health/v1/BUILD
index db04f3798d..6f6779594b 100644
--- a/src/proto/grpc/health/v1/BUILD
+++ b/src/proto/grpc/health/v1/BUILD
@@ -14,7 +14,13 @@
licenses(["notice"]) # Apache v2
-package(default_visibility = ["//visibility:public"])
+package(
+ default_visibility = ["//visibility:public"],
+ features = [
+ "-layering_check",
+ "-parse_headers",
+ ],
+)
load("//bazel:grpc_build_system.bzl", "grpc_proto_library")
diff --git a/src/proto/grpc/lb/v1/BUILD b/src/proto/grpc/lb/v1/BUILD
index 7fbfdfec72..61b28ee3bb 100644
--- a/src/proto/grpc/lb/v1/BUILD
+++ b/src/proto/grpc/lb/v1/BUILD
@@ -14,7 +14,13 @@
licenses(["notice"]) # Apache v2
-package(default_visibility = ["//visibility:public"])
+package(
+ default_visibility = ["//visibility:public"],
+ features = [
+ "-layering_check",
+ "-parse_headers",
+ ],
+)
load("//bazel:grpc_build_system.bzl", "grpc_proto_library")
diff --git a/src/proto/grpc/reflection/v1alpha/BUILD b/src/proto/grpc/reflection/v1alpha/BUILD
index 0d9df4fb47..b60784e9d9 100644
--- a/src/proto/grpc/reflection/v1alpha/BUILD
+++ b/src/proto/grpc/reflection/v1alpha/BUILD
@@ -14,7 +14,13 @@
licenses(["notice"]) # Apache v2
-package(default_visibility = ["//visibility:public"])
+package(
+ default_visibility = ["//visibility:public"],
+ features = [
+ "-layering_check",
+ "-parse_headers",
+ ],
+)
load("//bazel:grpc_build_system.bzl", "grpc_proto_library")
diff --git a/src/proto/grpc/status/BUILD b/src/proto/grpc/status/BUILD
index 10c162d3b2..61688e5f96 100644
--- a/src/proto/grpc/status/BUILD
+++ b/src/proto/grpc/status/BUILD
@@ -14,7 +14,13 @@
licenses(["notice"]) # Apache v2
-package(default_visibility = ["//visibility:public"])
+package(
+ default_visibility = ["//visibility:public"],
+ features = [
+ "-layering_check",
+ "-parse_headers",
+ ],
+)
load("//bazel:grpc_build_system.bzl", "grpc_proto_library")
@@ -22,5 +28,5 @@ grpc_proto_library(
name = "status_proto",
srcs = ["status.proto"],
has_services = False,
- well_known_protos = "@com_google_protobuf//:well_known_protos",
+ well_known_protos = True,
)
diff --git a/src/proto/grpc/testing/BUILD b/src/proto/grpc/testing/BUILD
index 0c27297ad1..c8e7d03cb0 100644
--- a/src/proto/grpc/testing/BUILD
+++ b/src/proto/grpc/testing/BUILD
@@ -14,7 +14,13 @@
licenses(["notice"]) # Apache v2
-package(default_visibility = ["//visibility:public"])
+package(
+ default_visibility = ["//visibility:public"],
+ features = [
+ "-layering_check",
+ "-parse_headers",
+ ],
+)
load("//bazel:grpc_build_system.bzl", "grpc_proto_library")
diff --git a/src/proto/grpc/testing/duplicate/BUILD b/src/proto/grpc/testing/duplicate/BUILD
index dd715d8da0..8f91710999 100644
--- a/src/proto/grpc/testing/duplicate/BUILD
+++ b/src/proto/grpc/testing/duplicate/BUILD
@@ -14,7 +14,13 @@
licenses(["notice"]) # Apache v2
-package(default_visibility = ["//visibility:public"])
+package(
+ default_visibility = ["//visibility:public"],
+ features = [
+ "-layering_check",
+ "-parse_headers",
+ ],
+)
load("//bazel:grpc_build_system.bzl", "grpc_proto_library")
diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/security.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/security.pyx.pxi
index 929aaa153c..7decae95bb 100644
--- a/src/python/grpcio/grpc/_cython/_cygrpc/security.pyx.pxi
+++ b/src/python/grpcio/grpc/_cython/_cygrpc/security.pyx.pxi
@@ -34,7 +34,7 @@ cdef grpc_ssl_roots_override_result ssl_roots_override_callback(
def peer_identities(Call call):
cdef grpc_auth_context* auth_context
cdef grpc_auth_property_iterator properties
- cdef grpc_auth_property* property
+ cdef const grpc_auth_property* property
auth_context = grpc_call_auth_context(call.c_call)
if auth_context == NULL:
@@ -52,7 +52,7 @@ def peer_identities(Call call):
def peer_identity_key(Call call):
cdef grpc_auth_context* auth_context
- cdef char* c_key
+ cdef const char* c_key
auth_context = grpc_call_auth_context(call.c_call)
if auth_context == NULL:
return None
@@ -67,7 +67,7 @@ def peer_identity_key(Call call):
def auth_context(Call call):
cdef grpc_auth_context* auth_context
cdef grpc_auth_property_iterator properties
- cdef grpc_auth_property* property
+ cdef const grpc_auth_property* property
auth_context = grpc_call_auth_context(call.c_call)
if auth_context == NULL: