File tree Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -101,18 +101,26 @@ swift::threading_impl::thread_get_current_stack_bounds() {
101101#if defined(__FreeBSD__)
102102 if (pthread_attr_init (&attr))
103103 return {};
104- #endif
105104
106- if (!pthread_getattr_np (pthread_self (), &attr)) {
107- if (!pthread_attr_getstack (&attr, &begin, &size)) {
108- stack_bounds result = { begin, (char *)begin + size };
109- pthread_attr_destroy (&attr);
110- return result;
111- }
105+ if (pthread_attr_get_np (pthread_self (), &attr)) {
106+ pthread_attr_destroy (&attr);
107+ return {};
108+ }
109+ #elif defined(__linux__)
110+ if (pthread_getattr_np (pthread_self (), &attr))
111+ return {};
112+ #else
113+ // We don't know how to get the thread attr for this platform.
114+ return {};
115+ #endif
112116
117+ if (!pthread_attr_getstack (&attr, &begin, &size)) {
118+ stack_bounds result = { begin, (char *)begin + size };
113119 pthread_attr_destroy (&attr);
120+ return result;
114121 }
115122
123+ pthread_attr_destroy (&attr);
116124 return {};
117125}
118126#endif
You can’t perform that action at this time.
0 commit comments