From cd569b91c04f1d434b8f05bb0f232e008edb2d78 Mon Sep 17 00:00:00 2001 From: Joohyun Kim Date: Tue, 2 Jul 2013 09:45:07 +0900 Subject: [PATCH] Fix pthread lock issue Change-Id: I69fad54289107e6c43451f963845aef9e3fbecd7 Signed-off-by: Joohyun Kim --- src/system/FSys_AlarmManager.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/system/FSys_AlarmManager.cpp b/src/system/FSys_AlarmManager.cpp index 06f8457..04dbd71 100644 --- a/src/system/FSys_AlarmManager.cpp +++ b/src/system/FSys_AlarmManager.cpp @@ -461,23 +461,17 @@ result _AlarmManager::UpdateAlarm(_AlarmImpl* pAlarmImpl) { result r = E_SUCCESS; - int ret = 0; Integer alarmId; - SysTryCatch(NID_SYS, pAlarmImpl != null, r = E_INVALID_ARG, r, "There is no alarmImpl."); - - ret = pthread_mutex_lock(&__lock); - SysTryCatch(NID_SYS, ret == 0, r = E_SYSTEM, r, "It is failed to lock mutex."); + SysTryReturnResult(NID_SYS, pAlarmImpl != null, E_SYSTEM, "There is no alarmImpl."); alarmId.value = pAlarmImpl->__alarmId.value; - SysTryCatch(NID_SYS, __alarmList.ContainsKey(alarmId) == true, r = E_OBJ_NOT_FOUND, r, "There is no registered alarm."); + SysTryReturnResult(NID_SYS, __alarmList.ContainsKey(alarmId) == true, E_SYSTEM, "There is no registered alarm."); r = UnregisterAlarm(pAlarmImpl); - SysTryCatch(NID_SYS, r == E_SUCCESS, r = E_SYSTEM, r, "It is failed to unregister reserved alarm list."); + SysTryReturnResult(NID_SYS, r == E_SUCCESS, E_SYSTEM, "It is failed to unregister reserved alarm list."); r = RegisterAlarm(pAlarmImpl); -CATCH: - ret = pthread_mutex_unlock(&__lock); - SysTryReturnResult(NID_SYS, ret == 0, E_SYSTEM, "It is failed to unlock mutex."); + SysTryReturnResult(NID_SYS, r == E_SUCCESS, E_SYSTEM, "It is failed to register alarm."); return r; } -- 2.7.4