mirror of
https://github.com/tobast/libunwind-eh_elf.git
synced 2024-11-02 08:09:27 +01:00
(unw_set_caching_policy): If caching-policy didn't change, return
early. Always flush cache after changing the policy. This is to ensure that the per-thread cache gets initialized and no stale info remains. (Logical change 1.118)
This commit is contained in:
parent
2245be9d9b
commit
8b3248c32e
1 changed files with 6 additions and 4 deletions
|
@ -35,10 +35,12 @@ unw_set_caching_policy (unw_addr_space_t as, unw_caching_policy_t policy)
|
||||||
if (policy == UNW_CACHE_PER_THREAD)
|
if (policy == UNW_CACHE_PER_THREAD)
|
||||||
policy = UNW_CACHE_GLOBAL;
|
policy = UNW_CACHE_GLOBAL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (policy == as->caching_policy)
|
||||||
|
return 0; /* no change */
|
||||||
|
|
||||||
as->caching_policy = policy;
|
as->caching_policy = policy;
|
||||||
|
/* Ensure caches are empty (and initialized). */
|
||||||
if (policy == UNW_CACHE_NONE)
|
unw_flush_cache (as, 0, 0);
|
||||||
unw_flush_cache (as, 0, 0);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue