int data;
} focus_idle_event_t;
-void _system_signal_handler(int signo)
+void _system_signal_handler(int signo, siginfo_t *siginfo, void *context)
{
int ret = MM_ERROR_NONE;
sigset_t old_mask, all_mask;
switch (signo) {
case SIGINT:
- sigaction(SIGINT, &system_int_old_action, NULL);
- raise( signo);
+ if (system_int_old_action.sa_sigaction)
+ system_int_old_action.sa_sigaction(signo, siginfo, context);
+ else
+ sigaction(signo, &system_int_old_action, NULL);
break;
case SIGABRT:
- sigaction(SIGABRT, &system_abrt_old_action, NULL);
- raise( signo);
+ if (system_abrt_old_action.sa_sigaction)
+ system_abrt_old_action.sa_sigaction(signo, siginfo, context);
+ else
+ sigaction(signo, &system_abrt_old_action, NULL);
break;
case SIGSEGV:
- sigaction(SIGSEGV, &system_segv_old_action, NULL);
- raise( signo);
+ if (system_segv_old_action.sa_sigaction)
+ system_segv_old_action.sa_sigaction(signo, siginfo, context);
+ else
+ sigaction(signo, &system_segv_old_action, NULL);
break;
case SIGTERM:
- sigaction(SIGTERM, &system_term_old_action, NULL);
- raise( signo);
+ if (system_term_old_action.sa_sigaction)
+ system_term_old_action.sa_sigaction(signo, siginfo, context);
+ else
+ sigaction(signo, &system_term_old_action, NULL);
break;
case SIGSYS:
- sigaction(SIGSYS, &system_sys_old_action, NULL);
- raise( signo);
+ if (system_sys_old_action.sa_sigaction)
+ system_sys_old_action.sa_sigaction(signo, siginfo, context);
+ else
+ sigaction(signo, &system_sys_old_action, NULL);
break;
case SIGXCPU:
- sigaction(SIGXCPU, &system_xcpu_old_action, NULL);
- raise( signo);
+ if (system_xcpu_old_action.sa_sigaction)
+ system_xcpu_old_action.sa_sigaction(signo, siginfo, context);
+ else
+ sigaction(signo, &system_xcpu_old_action, NULL);
break;
default:
break;
struct sigaction system_action;
- system_action.sa_handler = _system_signal_handler;
- system_action.sa_flags = SA_NOCLDSTOP;
+ system_action.sa_sigaction = _system_signal_handler;
+ system_action.sa_flags = SA_NOCLDSTOP | SA_SIGINFO;
sigemptyset(&system_action.sa_mask);
bool result;
debug_fenter();
- MMSOUND_ENTER_CRITICAL_SECTION_WITH_RETURN(&g_index_mutex, MM_ERROR_SOUND_INTERNAL);
+
+ /* Since the muse server which uses this library for multiple handles executes requests from clients serially,
+ * we can skip locking/unlocking the mutex for this case. */
+ if (!is_for_session)
+ MMSOUND_ENTER_CRITICAL_SECTION_WITH_RETURN(&g_index_mutex, MM_ERROR_SOUND_INTERNAL);
index = _focus_find_index_by_handle(id);
if (index == -1) {
debug_msg("set focus reacquisition(%d) for id(%d)", reacquisition, id);
cleanup:
- MMSOUND_LEAVE_CRITICAL_SECTION(&g_index_mutex);
+ if (!is_for_session)
+ MMSOUND_LEAVE_CRITICAL_SECTION(&g_index_mutex);
debug_fleave();
return ret;
}