File 0104-erts-Fix-debug-emulator-on-windows.patch of Package erlang

From 38cdf3a9e4afaae77633a2b010758d42b9855bc0 Mon Sep 17 00:00:00 2001
From: Sverker Eriksson <sverker@erlang.org>
Date: Thu, 27 Apr 2017 15:07:53 +0200
Subject: [PATCH] erts: Fix debug emulator on windows

Clear ethr_not_inited__ early (like on unix)
to not get assertion in ethr_tsd_key_create("stacklimit")
---
 erts/lib_src/win/ethread.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/erts/lib_src/win/ethread.c b/erts/lib_src/win/ethread.c
index ba77b3dc8..98fcd2d45 100644
--- a/erts/lib_src/win/ethread.c
+++ b/erts/lib_src/win/ethread.c
@@ -203,6 +203,8 @@ ethr_init(ethr_init_data *id)
     if (!ethr_not_inited__)
 	return EINVAL;
 
+    ethr_not_inited__ = 0;
+
 #ifdef _WIN32_WINNT
     os_version.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
     GetVersionEx(&os_version);
@@ -238,8 +240,6 @@ ethr_init(ethr_init_data *id)
     if (erts_get_cpu_configured(ethr_cpu_info__) == 1)
 	child_wait_spin_count = 0;
 
-    ethr_not_inited__ = 0;
-
     return 0;
 
  error:
-- 
2.12.2

openSUSE Build Service is sponsored by