build: Add stub _get_thread_info() needed by support/Referenceable.cpp
This is a step towards fixing #10042. When DEBUG is set BReferenceable::~BReferenceable() performs some checks ensuring that the object is destroyed correctly. These checks require information on thread stack, which is obtained by get_thread_info(). _get_thread_info() stub is added (actually, readded) which always returns B_ERROR. Moreover, the check in BReferenceable destructor is modified so that it does not fail when get_thread_info() fails.
This commit is contained in:
@@ -38,11 +38,11 @@ find_thread(const char *name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// _get_thread_info
|
// _get_thread_info
|
||||||
// status_t
|
status_t
|
||||||
// _get_thread_info(thread_id id, thread_info *info, size_t size)
|
_get_thread_info(thread_id id, thread_info* info, size_t size)
|
||||||
// {
|
{
|
||||||
// return B_ERROR;
|
return B_ERROR;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// _get_next_thread_info
|
// _get_next_thread_info
|
||||||
// status_t
|
// status_t
|
||||||
|
|||||||
@@ -47,8 +47,8 @@ BReferenceable::~BReferenceable()
|
|||||||
// stack range to be sure.
|
// stack range to be sure.
|
||||||
thread_info info;
|
thread_info info;
|
||||||
status_t result = get_thread_info(find_thread(NULL), &info);
|
status_t result = get_thread_info(find_thread(NULL), &info);
|
||||||
if (result != B_OK || this < info.stack_base
|
if (result == B_OK && (this < info.stack_base
|
||||||
|| this > info.stack_end) {
|
|| this > info.stack_end)) {
|
||||||
snprintf(message, sizeof(message), "Deleted referenceable "
|
snprintf(message, sizeof(message), "Deleted referenceable "
|
||||||
"object that's not on the stack (this: %p, stack_base: %p,"
|
"object that's not on the stack (this: %p, stack_base: %p,"
|
||||||
" stack_end: %p)\n", this, info.stack_base,
|
" stack_end: %p)\n", this, info.stack_base,
|
||||||
|
|||||||
Reference in New Issue
Block a user