mirror of
https://github.com/tobast/libunwind-eh_elf.git
synced 2025-03-31 19:42:17 +02:00
Fix a test failure
The test contains hints to users of unw_backtrace() and friends on how to ensure correctness in a multi-threaded program
This commit is contained in:
parent
814bd79fb1
commit
32202619c4
1 changed files with 4 additions and 1 deletions
|
@ -108,7 +108,6 @@ void
|
||||||
foo1 (void)
|
foo1 (void)
|
||||||
{
|
{
|
||||||
foo2 ();
|
foo2 ();
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -123,6 +122,10 @@ main (int argc, char **argv)
|
||||||
if (pthread_key_create (&key, NULL))
|
if (pthread_key_create (&key, NULL))
|
||||||
panic ("FAILURE: unable to create key %d\n", i);
|
panic ("FAILURE: unable to create key %d\n", i);
|
||||||
}
|
}
|
||||||
|
/* Call backtrace right after thread creation,
|
||||||
|
* where we are sure that we're not inside malloc */
|
||||||
|
do_backtrace();
|
||||||
|
num_mallocs = num_callocs = 0;
|
||||||
foo1 ();
|
foo1 ();
|
||||||
num_errors = num_mallocs + num_callocs;
|
num_errors = num_mallocs + num_callocs;
|
||||||
if (num_errors > 0)
|
if (num_errors > 0)
|
||||||
|
|
Loading…
Add table
Reference in a new issue