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() {
101
101
#if defined(__FreeBSD__)
102
102
if (pthread_attr_init (&attr))
103
103
return {};
104
- #endif
105
104
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
112
116
117
+ if (!pthread_attr_getstack (&attr, &begin, &size)) {
118
+ stack_bounds result = { begin, (char *)begin + size };
113
119
pthread_attr_destroy (&attr);
120
+ return result;
114
121
}
115
122
123
+ pthread_attr_destroy (&attr);
116
124
return {};
117
125
}
118
126
#endif
You can’t perform that action at this time.
0 commit comments