Skip to content
Snippets Groups Projects
Commit 5b0c4578 authored by kpayson64's avatar kpayson64 Committed by GitHub
Browse files

Merge pull request #10177 from kpayson64/no_gil

Change GIL aquire functions to make it c-core thread safe
parents c5302a0f 42053039
No related branches found
No related tags found
No related merge requests found
......@@ -29,4 +29,4 @@
cdef grpc_ssl_roots_override_result ssl_roots_override_callback(
char **pem_root_certs) with gil
char **pem_root_certs) nogil
......@@ -33,12 +33,14 @@ import pkg_resources
cdef grpc_ssl_roots_override_result ssl_roots_override_callback(
char **pem_root_certs) with gil:
temporary_pem_root_certs = pkg_resources.resource_string(
__name__.rstrip('.cygrpc'), '_credentials/roots.pem')
pem_root_certs[0] = <char *>gpr_malloc(len(temporary_pem_root_certs) + 1)
memcpy(
pem_root_certs[0], <char *>temporary_pem_root_certs,
len(temporary_pem_root_certs))
pem_root_certs[0][len(temporary_pem_root_certs)] = '\0'
char **pem_root_certs) nogil:
with gil:
temporary_pem_root_certs = pkg_resources.resource_string(
__name__.rstrip('.cygrpc'), '_credentials/roots.pem')
pem_root_certs[0] = <char *>gpr_malloc(len(temporary_pem_root_certs) + 1)
memcpy(
pem_root_certs[0], <char *>temporary_pem_root_certs,
len(temporary_pem_root_certs))
pem_root_certs[0][len(temporary_pem_root_certs)] = '\0'
return GRPC_SSL_ROOTS_OVERRIDE_OK
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment