mirror of
https://github.com/tobast/libunwind-eh_elf.git
synced 2024-11-21 23:27:39 +01: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)
|
||||
{
|
||||
foo2 ();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -123,6 +122,10 @@ main (int argc, char **argv)
|
|||
if (pthread_key_create (&key, NULL))
|
||||
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 ();
|
||||
num_errors = num_mallocs + num_callocs;
|
||||
if (num_errors > 0)
|
||||
|
|
Loading…
Reference in a new issue