mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user