From 88162f82c407e3025d3e157705b3aade63da675f Mon Sep 17 00:00:00 2001
From: Michael Lumish <mlumish@google.com>
Date: Thu, 12 Jan 2017 17:37:58 -0800
Subject: [PATCH] Do not use OPENSSL_NO_THREAD normally for Node on Windows

---
 binding.gyp                    | 8 ++++++--
 templates/binding.gyp.template | 8 ++++++--
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/binding.gyp b/binding.gyp
index bb1c7f0a3a1..fd48da875a8 100644
--- a/binding.gyp
+++ b/binding.gyp
@@ -54,14 +54,18 @@
           'GRPC_UV'
         ]
       }],
+      ['runtime=="electron"', {
+        "defines": [
+          'OPENSSL_NO_THREADS'
+        ]
+      }],
       # This is the condition for using boringssl
       ['OS=="win" or runtime=="electron"', {
         "include_dirs": [
           "third_party/boringssl/include"
         ],
         "defines": [
-          'OPENSSL_NO_ASM',
-          'OPENSSL_NO_THREADS'
+          'OPENSSL_NO_ASM'
         ]
       }, {
         # Based on logic above, we know that this must be a non-Windows system
diff --git a/templates/binding.gyp.template b/templates/binding.gyp.template
index 9b9e4e116d0..7570aa5e7ee 100644
--- a/templates/binding.gyp.template
+++ b/templates/binding.gyp.template
@@ -56,14 +56,18 @@
             'GRPC_UV'
           ]
         }],
+        ['runtime=="electron"', {
+          "defines": [
+            'OPENSSL_NO_THREADS'
+          ]
+        }],
         # This is the condition for using boringssl
         ['OS=="win" or runtime=="electron"', {
           "include_dirs": [
             "third_party/boringssl/include"
           ],
           "defines": [
-            'OPENSSL_NO_ASM',
-            'OPENSSL_NO_THREADS'
+            'OPENSSL_NO_ASM'
           ]
         }, {
           # Based on logic above, we know that this must be a non-Windows system