1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-11-17 13:47:37 +01:00

(get_script_cache): Need to disable signal-delivery even for per-thread

caching.
(put_script_cache): Need to re-enable signal-delivery even for
	per-thread caching.

(Logical change 1.118)
This commit is contained in:
hp.com!davidm 2003-11-22 06:21:26 +00:00
parent 984170936a
commit 2245be9d9b

View file

@ -71,17 +71,22 @@ static inline struct ia64_script_cache *
get_script_cache (unw_addr_space_t as, sigset_t *saved_sigmaskp) get_script_cache (unw_addr_space_t as, sigset_t *saved_sigmaskp)
{ {
struct ia64_script_cache *cache = &as->global_cache; struct ia64_script_cache *cache = &as->global_cache;
unw_caching_policy_t caching = as->caching_policy;
#ifdef HAVE___THREAD #ifdef HAVE___THREAD
if (as->caching_policy == UNW_CACHE_PER_THREAD) if (as->caching_policy == UNW_CACHE_PER_THREAD)
cache = &ia64_per_thread_cache; cache = &ia64_per_thread_cache;
#endif #endif
if (likely (as->caching_policy == UNW_CACHE_GLOBAL)) if (likely (caching != UNW_CACHE_NONE))
{ {
sigprocmask (SIG_SETMASK, &unwi_full_sigmask, saved_sigmaskp); sigprocmask (SIG_SETMASK, &unwi_full_sigmask, saved_sigmaskp);
if (likely (caching == UNW_CACHE_GLOBAL))
{
debug (200, "%s: acquiring lock\n", __FUNCTION__);
mutex_lock (&cache->lock); mutex_lock (&cache->lock);
} }
}
if (as->cache_generation != cache->generation) if (as->cache_generation != cache->generation)
{ {
@ -95,8 +100,12 @@ static inline void
put_script_cache (unw_addr_space_t as, struct ia64_script_cache *cache, put_script_cache (unw_addr_space_t as, struct ia64_script_cache *cache,
sigset_t *saved_sigmaskp) sigset_t *saved_sigmaskp)
{ {
if (likely (as->caching_policy == UNW_CACHE_GLOBAL)) unw_caching_policy_t caching = as->caching_policy;
if (likely (caching != UNW_CACHE_NONE))
{ {
debug (200, "%s: unmasking signals/releasing lock\n", __FUNCTION__);
if (likely (caching == UNW_CACHE_GLOBAL))
mutex_unlock (&cache->lock); mutex_unlock (&cache->lock);
sigprocmask (SIG_SETMASK, saved_sigmaskp, NULL); sigprocmask (SIG_SETMASK, saved_sigmaskp, NULL);
} }