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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
3a488085
"...git@gitlab.uni-hannover.de:tci-gateway-module/grpc.git" did not exist on "8251fdd46131a54d05808f71489ed3b2133c0c65"
Commit
3a488085
authored
9 years ago
by
Craig Tiller
Browse files
Options
Downloads
Patches
Plain Diff
Ruby progress
parent
c7313235
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/ruby/ext/grpc/rb_completion_queue.c
+5
-14
5 additions, 14 deletions
src/ruby/ext/grpc/rb_completion_queue.c
src/ruby/ext/grpc/rb_completion_queue.h
+2
-2
2 additions, 2 deletions
src/ruby/ext/grpc/rb_completion_queue.h
with
7 additions
and
16 deletions
src/ruby/ext/grpc/rb_completion_queue.c
+
5
−
14
View file @
3a488085
...
...
@@ -47,7 +47,7 @@ static VALUE grpc_rb_cCompletionQueue = Qnil;
/* Used to allow grpc_completion_queue_next call to release the GIL */
typedef
struct
next_call_stack
{
grpc_completion_queue
*
cq
;
grpc_event
*
event
;
grpc_event
event
;
gpr_timespec
timeout
;
void
*
tag
;
}
next_call_stack
;
...
...
@@ -145,12 +145,9 @@ static VALUE grpc_rb_completion_queue_next(VALUE self, VALUE timeout) {
TypedData_Get_Struct
(
self
,
grpc_completion_queue
,
&
grpc_rb_completion_queue_data_type
,
next_call
.
cq
);
next_call
.
timeout
=
grpc_rb_time_timeval
(
timeout
,
/* absolute time*/
0
);
next_call
.
event
=
NULL
;
next_call
.
event
.
type
=
GRPC_QUEUE_TIMEOUT
;
rb_thread_call_without_gvl
(
grpc_rb_completion_queue_next_no_gil
,
(
void
*
)
&
next_call
,
NULL
,
NULL
);
if
(
next_call
.
event
==
NULL
)
{
return
Qnil
;
}
return
grpc_rb_new_event
(
next_call
.
event
);
}
...
...
@@ -158,17 +155,14 @@ static VALUE grpc_rb_completion_queue_next(VALUE self, VALUE timeout) {
* event. */
VALUE
grpc_rb_completion_queue_pluck
(
VALUE
self
,
VALUE
tag
,
VALUE
timeout
)
{
grpc_event
*
ev
=
grpc_rb_completion_queue_pluck_event
(
self
,
tag
,
timeout
);
if
(
ev
==
NULL
)
{
return
Qnil
;
}
grpc_event
ev
=
grpc_rb_completion_queue_pluck_event
(
self
,
tag
,
timeout
);
return
grpc_rb_new_event
(
ev
);
}
/* Blocks until the next event for given tag is available, and returns the
* event. */
grpc_event
*
grpc_rb_completion_queue_pluck_event
(
VALUE
self
,
VALUE
tag
,
VALUE
timeout
)
{
grpc_event
grpc_rb_completion_queue_pluck_event
(
VALUE
self
,
VALUE
tag
,
VALUE
timeout
)
{
next_call_stack
next_call
;
MEMZERO
(
&
next_call
,
next_call_stack
,
1
);
TypedData_Get_Struct
(
self
,
grpc_completion_queue
,
...
...
@@ -178,9 +172,6 @@ grpc_event* grpc_rb_completion_queue_pluck_event(VALUE self, VALUE tag,
next_call
.
event
=
NULL
;
rb_thread_call_without_gvl
(
grpc_rb_completion_queue_pluck_no_gil
,
(
void
*
)
&
next_call
,
NULL
,
NULL
);
if
(
next_call
.
event
==
NULL
)
{
return
NULL
;
}
return
next_call
.
event
;
}
...
...
This diff is collapsed.
Click to expand it.
src/ruby/ext/grpc/rb_completion_queue.h
+
2
−
2
View file @
3a488085
...
...
@@ -45,8 +45,8 @@ grpc_completion_queue *grpc_rb_get_wrapped_completion_queue(VALUE v);
*
* This avoids having code that holds the GIL repeated at multiple sites.
*/
grpc_event
*
grpc_rb_completion_queue_pluck_event
(
VALUE
cqueue
,
VALUE
tag
,
VALUE
timeout
);
grpc_event
grpc_rb_completion_queue_pluck_event
(
VALUE
cqueue
,
VALUE
tag
,
VALUE
timeout
);
/* Initializes the CompletionQueue class. */
void
Init_grpc_completion_queue
();
...
...
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