diff options
author | Dan Born <dborn@google.com> | 2016-12-20 13:48:11 -0800 |
---|---|---|
committer | Dan Born <dborn@google.com> | 2016-12-20 13:48:11 -0800 |
commit | e955c1f2367288f5e7047e33c48ad55ad58a9c80 (patch) | |
tree | 388c6c4be603fbb3da669e2a6324629537571845 /src | |
parent | 1a741606feb3c110c7b17b2cf00e18ee97decc72 (diff) |
Method to expose the resource quota of a resource user
Diffstat (limited to 'src')
-rw-r--r-- | src/core/lib/iomgr/resource_quota.c | 5 | ||||
-rw-r--r-- | src/core/lib/iomgr/resource_quota.h | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/core/lib/iomgr/resource_quota.c b/src/core/lib/iomgr/resource_quota.c index 213d29600c..74c6c3e0fb 100644 --- a/src/core/lib/iomgr/resource_quota.c +++ b/src/core/lib/iomgr/resource_quota.c @@ -695,6 +695,11 @@ grpc_resource_user *grpc_resource_user_create( return resource_user; } +grpc_resource_quota *grpc_resource_user_quota( + grpc_resource_user *resource_user) { + return resource_user->resource_quota; +} + static void ru_ref_by(grpc_resource_user *resource_user, gpr_atm amount) { GPR_ASSERT(amount > 0); GPR_ASSERT(gpr_atm_no_barrier_fetch_add(&resource_user->refs, amount) != 0); diff --git a/src/core/lib/iomgr/resource_quota.h b/src/core/lib/iomgr/resource_quota.h index 0181fd978b..14475c864e 100644 --- a/src/core/lib/iomgr/resource_quota.h +++ b/src/core/lib/iomgr/resource_quota.h @@ -88,6 +88,8 @@ typedef struct grpc_resource_user grpc_resource_user; grpc_resource_user *grpc_resource_user_create( grpc_resource_quota *resource_quota, const char *name); +grpc_resource_quota *grpc_resource_user_quota( + grpc_resource_user *resource_user); void grpc_resource_user_ref(grpc_resource_user *resource_user); void grpc_resource_user_unref(grpc_exec_ctx *exec_ctx, grpc_resource_user *resource_user); |