[Threading] Move stack bounds fetching into the threading library.

Fetching the current stack bounds is done using threading functions, so
should be in the threading library.

rdar://90776105
This commit is contained in:
Alastair Houghton
2022-05-06 10:59:48 +01:00
parent eb4c81d60e
commit b5c8b79556
12 changed files with 134 additions and 82 deletions

View File

@@ -27,6 +27,7 @@ namespace swift {
class Thread {
public:
using Id = threading_impl::thread_id;
using StackBounds = threading_impl::stack_bounds;
private:
Id id_;
@@ -65,6 +66,11 @@ public:
bool operator!=(const Thread &other) const {
return !threading_impl::threads_same(id_, other.id_);
}
// Retrieve the bounds of the current thread's stack
static StackBounds stackBounds() {
return threading_impl::thread_get_current_stack_bounds();
}
};
} // namespace swift