Skip to content

Commit f4293bc

Browse files
committed
revert: Remove thread safety changes extracted to PR #7672
Revert atomic operations changes to SentryNSExceptionCaptureHelper.m that were extracted to a separate PR #7672 for independent review. This keeps our PR focused on the SentryObjC wrapper SDK functionality. Refs #6342 Refs #7672
1 parent 5c6380c commit f4293bc

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

Sources/Sentry/SentryNSExceptionCaptureHelper.m

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,28 @@
55
# import "SentryCrash.h"
66
# import "SentryNSExceptionCaptureHelper.h"
77
# import "SentrySwift.h"
8-
# import <stdatomic.h>
98

109
@implementation SentryNSExceptionCaptureHelper
1110

12-
// Thread-safe flag to prevent duplicate exception captures when
13-
// _crashOnException: is called from within reportException:
14-
static _Atomic BOOL _insideReportException = NO;
11+
static BOOL _insideReportException = NO;
1512

1613
+ (void)reportException:(NSException *)exception
1714
{
18-
atomic_store(&_insideReportException, YES);
15+
_insideReportException = YES;
1916
[self captureException:exception];
2017
}
2118

2219
+ (void)reportExceptionDidFinish
2320
{
24-
atomic_store(&_insideReportException, NO);
21+
_insideReportException = NO;
2522
}
2623

2724
+ (void)crashOnException:(NSException *)exception
2825
{
2926
// When called from within reportException: (i.e., [super reportException:] internally
3027
// dispatches to _crashOnException: when NSApplicationCrashOnExceptions is YES),
3128
// the exception was already captured, so skip to avoid duplicate reports.
32-
if (!atomic_load(&_insideReportException)) {
29+
if (!_insideReportException) {
3330
[self captureException:exception];
3431
}
3532
}

0 commit comments

Comments
 (0)