summaryrefslogtreecommitdiff
path: root/packaging/0022-CatchHardwareExceptionHolder-use-GetCurrentPalThread.patch
blob: 5431ee0c0ad726092c15560e66ceeb028c799c34 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From 7c577d168dfc4b76516437c3220a5ccbd8607e37 Mon Sep 17 00:00:00 2001
From: Konstantin Baladurin <k.baladurin@partner.samsung.com>
Date: Tue, 13 Feb 2018 15:56:58 +0300
Subject: [PATCH 22/47] CatchHardwareExceptionHolder: use GetCurrentPalThread
 instead of InternalGetCurrentThread in IsEnabled method.

InternalGetCurrentThread tries to create pal thread if it doesn't
exist for the current thread. It's unnecessary because in this case
there are no hardware exception handlers for such thread.

Also CatchHardwareExceptionHolder::IsEnable is called from signal
handlers and during pal thread creation non-async-signal-safe
function are called.
---
 src/pal/src/exception/seh.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/pal/src/exception/seh.cpp b/src/pal/src/exception/seh.cpp
index 2d1c182..0574fad 100644
--- a/src/pal/src/exception/seh.cpp
+++ b/src/pal/src/exception/seh.cpp
@@ -374,8 +374,8 @@ CatchHardwareExceptionHolder::~CatchHardwareExceptionHolder()
 
 bool CatchHardwareExceptionHolder::IsEnabled()
 {
-    CPalThread *pThread = InternalGetCurrentThread();
-    return pThread->IsHardwareExceptionsEnabled();
+    CPalThread *pThread = GetCurrentPalThread();
+    return pThread ? pThread->IsHardwareExceptionsEnabled() : false;
 }
 
 /*++
-- 
2.7.4