Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check MACH_PORT_VALID on return from pthread_mach_thread_np #3520

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Format code
  • Loading branch information
getsentry-bot committed Dec 27, 2023
commit c4496eecd28260b77e8b868f9fba876843a13075
5 changes: 2 additions & 3 deletions Sources/Sentry/PrivateSentrySDKOnly.mm
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,8 @@ + (uint64_t)startProfilerForTrace:(SentryId *)traceId;
if (payload != nil) {
const auto thread = sentry::profiling::ThreadHandle::current();
payload[@"platform"] = SentryPlatformName;
payload[@"transaction"] = @{
@"active_thread_id" : (thread == nullptr) ? @0 : @(thread->tid())
};
payload[@"transaction"] =
@{ @"active_thread_id" : (thread == nullptr) ? @0 : @(thread->tid()) };
}

return payload;
Expand Down
2 changes: 1 addition & 1 deletion Sources/Sentry/SentryThreadHandle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ namespace profiling {
if (current == nullptr) {
return std::make_pair(threads, nullptr);
philipphofmann marked this conversation as resolved.
Show resolved Hide resolved
}

if (SENTRY_PROF_LOG_KERN_RETURN(task_threads(mach_task_self(), &list, &count))
== KERN_SUCCESS) {
for (decltype(count) i = 0; i < count; i++) {
Expand Down
3 changes: 2 additions & 1 deletion Sources/Sentry/SentryTransactionContext.mm
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ - (void)getThreadInfo
{
#if SENTRY_TARGET_PROFILING_SUPPORTED
const auto thread = sentry::profiling::ThreadHandle::current();
self.threadInfo = [[SentryThread alloc] initWithThreadId:(thread == nullptr) ? @0 : @(thread->tid())];
self.threadInfo =
[[SentryThread alloc] initWithThreadId:(thread == nullptr) ? @0 : @(thread->tid())];
#endif
}

Expand Down