Skip to content

Crash in channel/server creation if grpc_init not called#964

Merged
nicolasnoble merged 2 commits intogrpc:masterfrom
ctiller:i-am-so-very-lazy
Mar 6, 2015
Merged

Crash in channel/server creation if grpc_init not called#964
nicolasnoble merged 2 commits intogrpc:masterfrom
ctiller:i-am-so-very-lazy

Conversation

@ctiller
Copy link
Copy Markdown
Member

@ctiller ctiller commented Mar 6, 2015

@tbetbetbe - Fixes #278

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got slightly confused btw - I think "do_init" might be a misnomer. But I don't see any better name for it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pushed an update -- WDYT?

On Thu, Mar 5, 2015 at 5:12 PM Nicolas Noble notifications@github.com
wrote:

In src/core/surface/init.c
#964 (comment):

@@ -73,3 +73,13 @@ void grpc_shutdown(void) {
}
gpr_mu_unlock(&g_init_mu);
}
+
+int grpc_is_initialized(void) {

  • int r;
  • gpr_once_init(&g_init, do_init);

I got slightly confused btw - I think "do_init" might be a misnomer. But I
don't see any better name for it.


Reply to this email directly or view it on GitHub
https://github.com/grpc/grpc/pull/964/files#r25918566.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, fair enough. I'll wait until it goes green again :-)

On Thu, Mar 5, 2015 at 5:16 PM, Craig Tiller notifications@github.com
wrote:

In src/core/surface/init.c
#964 (comment):

@@ -73,3 +73,13 @@ void grpc_shutdown(void) {
}
gpr_mu_unlock(&g_init_mu);
}
+
+int grpc_is_initialized(void) {

  • int r;
  • gpr_once_init(&g_init, do_init);

Pushed an update -- WDYT?
… <#14beca7de80d4878_>
On Thu, Mar 5, 2015 at 5:12 PM Nicolas Noble notifications@github.com
wrote: In src/core/surface/init.c <
https://github.com/grpc/grpc/pull/964#discussion_r25918566>: > @@ -73,3
+73,13 @@ void grpc_shutdown(void) { > } > gpr_mu_unlock(&g_init_mu); > } >

  • +int grpc_is_initialized(void) { > + int r; > + gpr_once_init(&g_init,
    do_init); I got slightly confused btw - I think "do_init" might be a
    misnomer. But I don't see any better name for it. — Reply to this email
    directly or view it on GitHub <
    https://github.com/grpc/grpc/pull/964/files#r25918566>.


Reply to this email directly or view it on GitHub
https://github.com/grpc/grpc/pull/964/files#r25918725.

nicolasnoble added a commit that referenced this pull request Mar 6, 2015
Crash in channel/server creation if grpc_init not called
@nicolasnoble nicolasnoble merged commit d3be281 into grpc:master Mar 6, 2015
@lock lock bot locked as resolved and limited conversation to collaborators Feb 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash at channel creation time if grpc not initialized

3 participants