Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
0c6cce12
Commit
0c6cce12
authored
Aug 15, 2016
by
kpayson64
Committed by
GitHub
Aug 15, 2016
Browse files
Options
Downloads
Plain Diff
Merge pull request #7648 from vjpai/qps_better_ptr
Use unique_ptr properly in QPS async tests
parents
5a22a598
4f17395b
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/cpp/qps/server_async.cc
+3
-7
3 additions, 7 deletions
test/cpp/qps/server_async.cc
with
3 additions
and
7 deletions
test/cpp/qps/server_async.cc
+
3
−
7
View file @
0c6cce12
...
@@ -108,14 +108,14 @@ class AsyncQpsServerTest : public Server {
...
@@ -108,14 +108,14 @@ class AsyncQpsServerTest : public Server {
auto
request_unary
=
auto
request_unary
=
std
::
bind
(
request_unary_function
,
&
async_service_
,
_1
,
_2
,
_3
,
std
::
bind
(
request_unary_function
,
&
async_service_
,
_1
,
_2
,
_3
,
srv_cqs_
[
j
].
get
(),
srv_cqs_
[
j
].
get
(),
_4
);
srv_cqs_
[
j
].
get
(),
srv_cqs_
[
j
].
get
(),
_4
);
contexts_
.
push_front
(
contexts_
.
emplace_back
(
new
ServerRpcContextUnaryImpl
(
request_unary
,
process_rpc_bound
));
new
ServerRpcContextUnaryImpl
(
request_unary
,
process_rpc_bound
));
}
}
if
(
request_streaming_function
)
{
if
(
request_streaming_function
)
{
auto
request_streaming
=
auto
request_streaming
=
std
::
bind
(
request_streaming_function
,
&
async_service_
,
_1
,
_2
,
std
::
bind
(
request_streaming_function
,
&
async_service_
,
_1
,
_2
,
srv_cqs_
[
j
].
get
(),
srv_cqs_
[
j
].
get
(),
_3
);
srv_cqs_
[
j
].
get
(),
srv_cqs_
[
j
].
get
(),
_3
);
contexts_
.
push_front
(
new
ServerRpcContextStreamingImpl
(
contexts_
.
emplace_back
(
new
ServerRpcContextStreamingImpl
(
request_streaming
,
process_rpc_bound
));
request_streaming
,
process_rpc_bound
));
}
}
}
}
...
@@ -146,10 +146,6 @@ class AsyncQpsServerTest : public Server {
...
@@ -146,10 +146,6 @@ class AsyncQpsServerTest : public Server {
while
((
*
cq
)
->
Next
(
&
got_tag
,
&
ok
))
while
((
*
cq
)
->
Next
(
&
got_tag
,
&
ok
))
;
;
}
}
while
(
!
contexts_
.
empty
())
{
delete
contexts_
.
front
();
contexts_
.
pop_front
();
}
}
}
private
:
private
:
...
@@ -336,7 +332,7 @@ class AsyncQpsServerTest : public Server {
...
@@ -336,7 +332,7 @@ class AsyncQpsServerTest : public Server {
std
::
unique_ptr
<
grpc
::
Server
>
server_
;
std
::
unique_ptr
<
grpc
::
Server
>
server_
;
std
::
vector
<
std
::
unique_ptr
<
grpc
::
ServerCompletionQueue
>>
srv_cqs_
;
std
::
vector
<
std
::
unique_ptr
<
grpc
::
ServerCompletionQueue
>>
srv_cqs_
;
ServiceType
async_service_
;
ServiceType
async_service_
;
std
::
forward_list
<
ServerRpcContext
*
>
contexts_
;
std
::
vector
<
std
::
unique_ptr
<
ServerRpcContext
>
>
contexts_
;
struct
PerThreadShutdownState
{
struct
PerThreadShutdownState
{
mutable
std
::
mutex
mutex
;
mutable
std
::
mutex
mutex
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment