#include "MsgDevicedWrapper.h"
int g_lock_cnt = 0;
-Mutex mx;
+MsgMutex mx;
void MsgDisplayLock()
{
VARIABLES
==================================================================================================*/
-Mutex delNotiMx;
-CndVar delNoticv;
+MsgMutex delNotiMx;
+MsgCndVar delNoticv;
bool delNotiRunning = false;
-Mutex delLogMx;
-CndVar delLogcv;
+MsgMutex delLogMx;
+MsgCndVar delLogcv;
bool delLogRunning = false;
FUNCTION IMPLEMENTATION
==================================================================================================*/
-Mutex mx;
+MsgMutex mx;
int g_job_cnt = 0;
static gboolean __refresh_noti(void *data)
MSG_DEBUG("msg for submit: reqId %d listenerFd %d handleAddr %x", reqId, pPrxInfo->listenerFd, pPrxInfo->handleAddr);
- MutexLocker lock(mx);
+ MsgMutexLocker lock(mx);
fd_map::iterator it = statusCBFdMap.find(pPrxInfo->listenerFd);
void MsgTransactionManager::delProxyInfo(int reqId)
{
- MutexLocker lock(mx);
+ MsgMutexLocker lock(mx);
sentmsg_map::iterator it = sentMsgMap.find(reqId);
mxQ.lock();
while (!eventQueue.front(&pCmd)) { /* if no item, wait */
MSG_DEBUG("waiting for task");
- cv.wait(mxQ.pMutex());
+ cv.wait(mxQ.pMsgMutex());
}
eventQueue.pop_front(); /* pop it from queue*/
mxQ.unlock();
{
MSG_BEGIN();
- MutexLocker lock(mx);
+ MsgMutexLocker lock(mx);
servSock.close(fd);
return;
}
- MutexLocker lock(mx);
+ MsgMutexLocker lock(mx);
newmsg_list::iterator it = newMsgCBList.begin();
return;
}
- MutexLocker lock(mx);
+ MsgMutexLocker lock(mx);
mmsconf_list::iterator it = newMMSConfMsgCBList.begin();
return;
}
- MutexLocker lock(mx);
+ MsgMutexLocker lock(mx);
pushmsg_list::iterator it = newPushMsgCBList.begin();
return;
}
- MutexLocker lock(mx);
+ MsgMutexLocker lock(mx);
cbmsg_list::iterator it = newCBMsgCBList.begin();
return;
}
- MutexLocker lock(mx);
+ MsgMutexLocker lock(mx);
syncmlmsg_list::iterator it = newSyncMLMsgCBList.begin();
return;
}
- MutexLocker lock(mx);
+ MsgMutexLocker lock(mx);
lbsmsg_list::iterator it = newLBSMsgCBList.begin();
return;
}
- MutexLocker lock(mx);
+ MsgMutexLocker lock(mx);
syncmlop_list::iterator it = operationSyncMLMsgCBList.begin();
if (listenerFd <= 0)
THROW(MsgException::INVALID_PARAM, "InParam Error: listenerFd %d", listenerFd);
- MutexLocker lock(mx);
+ MsgMutexLocker lock(mx);
storageChangeFdMap[listenerFd] = true;
}
if (listenerFd <= 0)
THROW(MsgException::INVALID_PARAM, "InParam Error: listenerFd %d", listenerFd);
- MutexLocker lock(mx);
+ MsgMutexLocker lock(mx);
reportMsgCBFdMap[listenerFd] = true;
}
MSG_DEBUG("valid %d dstport %d", msgInfo->msgPort.valid, msgInfo->msgPort.dstPort);
- MutexLocker lock(mx);
+ MsgMutexLocker lock(mx);
newmsg_list::iterator it = newMsgCBList.begin();
int eventSize = MsgMakeEvent(encodedData, dataSize, MSG_EVENT_PLG_INCOMING_MMS_CONF, err, (void**)(&pEventData));
- MutexLocker lock(mx);
+ MsgMutexLocker lock(mx);
mmsconf_list::iterator it = newMMSConfMsgCBList.begin();
int eventSize = MsgMakeEvent(pushData, sizeof(MSG_PUSH_MESSAGE_DATA_S), MSG_EVENT_PLG_INCOMING_PUSH_MSG_IND, err, (void**)(&pEventData));
- MutexLocker lock(mx);
+ MsgMutexLocker lock(mx);
pushmsg_list::iterator it = newPushMsgCBList.begin();
int eventSize = MsgMakeEvent(cbMsg, sizeof(MSG_CB_MSG_S), MSG_EVENT_PLG_INCOMING_CB_MSG_IND, err, (void**)(&pEventData));
- MutexLocker lock(mx);
+ MsgMutexLocker lock(mx);
cbmsg_list::iterator it = newCBMsgCBList.begin();
int eventSize = MsgMakeEvent(syncMLData, sizeof(MSG_SYNCML_MESSAGE_DATA_S), MSG_EVENT_PLG_INCOMING_SYNCML_MSG_IND, err, (void**)(&pEventData));
- MutexLocker lock(mx);
+ MsgMutexLocker lock(mx);
syncmlmsg_list::iterator it = newSyncMLMsgCBList.begin();
int eventSize = MsgMakeEvent(lbsData, sizeof(MSG_LBS_MESSAGE_DATA_S), MSG_EVENT_PLG_INCOMING_LBS_MSG_IND, err, (void**)(&pEventData));
- MutexLocker lock(mx);
+ MsgMutexLocker lock(mx);
lbsmsg_list::iterator it = newLBSMsgCBList.begin();
int eventSize = MsgMakeEvent(encodedData, dataSize, MSG_EVENT_SYNCML_OPERATION, err, (void**)(&pEventData));
- MutexLocker lock(mx);
+ MsgMutexLocker lock(mx);
syncmlop_list::iterator it = operationSyncMLMsgCBList.begin();
int eventSize = MsgMakeEvent(encodedData, dataSize, MSG_EVENT_PLG_STORAGE_CHANGE_IND, err, (void**)(&pEventData));
- MutexLocker lock(mx);
+ MsgMutexLocker lock(mx);
fd_map::iterator it = storageChangeFdMap.begin();
int eventSize = MsgMakeEvent(encodedData, dataSize, MSG_EVENT_PLG_REPORT_MSG_INCOMING_IND, err, (void**)(&pEventData));
- MutexLocker lock(mx);
+ MsgMutexLocker lock(mx);
fd_map::iterator it = reportMsgCBFdMap.begin();
fd_map storageChangeFdMap;
fd_map reportMsgCBFdMap;
- Mutex mx; /* mutex for shared resources like callback listeners */
- Mutex mxQ; /* mutex for event queue */
- CndVar cv;
+ MsgMutex mx; /* mutex for shared resources like callback listeners */
+ MsgMutex mxQ; /* mutex for event queue */
+ MsgCndVar cv;
MsgSimpleQ<MSG_CMD_S*> eventQueue;
cynara *p_cynara;
char mCookie[MAX_COOKIE_LEN];
MsgIpcClientSocket mClientSock;
- Mutex mx;
+ MsgMutex mx;
};
#endif /* MSG_HANDLE_H */
MsgIpcClientSocket cliSock;
- Mutex mx;
- CndVar cv;
+ MsgMutex mx;
+ MsgCndVar cv;
MsgSentStatusCBList sentStatusCBList;
MsgNewMessageCBList newMessageCBList;
int GetMsgReady();
void WaitMsgReady(int sec);
-class Mutex
+class MsgMutex
{
public:
- Mutex() {
+ MsgMutex() {
pthread_mutexattr_t mattr;
pthread_mutexattr_init(&mattr);
pthread_mutexattr_settype(&mattr, PTHREAD_MUTEX_RECURSIVE);
pthread_mutex_init(&m, &mattr);
pthread_mutexattr_destroy(&mattr);
}
- ~Mutex() { pthread_mutex_destroy(&m); }
+ ~MsgMutex() { pthread_mutex_destroy(&m); }
void lock() { pthread_mutex_lock(&m); }
int timedlock() {
}
void unlock() { pthread_mutex_unlock(&m); }
- pthread_mutex_t* pMutex() { return &m; }
+ pthread_mutex_t* pMsgMutex() { return &m; }
private:
pthread_mutex_t m;
};
-class MutexLocker
+class MsgMutexLocker
{
public:
- MutexLocker(Mutex& mx) {
+ MsgMutexLocker(MsgMutex& mx) {
pm = &mx;
pm->lock();
}
- ~MutexLocker() {
+ ~MsgMutexLocker() {
pm->unlock();
}
private:
- Mutex *pm;
+ MsgMutex *pm;
};
-class CndVar
+class MsgCndVar
{
public:
- CndVar() { pthread_cond_init(&c, 0); }
+ MsgCndVar() { pthread_cond_init(&c, 0); }
+ ~MsgCndVar() { pthread_cond_destroy(&c); }
void wait(pthread_mutex_t* m) { pthread_cond_wait(&c, m); }
int timedwait(pthread_mutex_t* m, int sec) {
struct timeval now = {0};
#define MMS_CONTEXT_INVOKE_WAIT_TIME 30
#define MMS_CONNECTION_API_WAIT_TIME 420
-static Mutex g_mx;
-static CndVar g_cv;
+static MsgMutex g_mx;
+static MsgCndVar g_cv;
static connection_h g_connection = NULL;
static connection_profile_h g_profile = NULL;
MSG_INFO("@@ WAIT @@");
- time_ret = g_cv.timedwait(g_mx.pMutex(), MMS_CONTEXT_INVOKE_WAIT_TIME);
+ time_ret = g_cv.timedwait(g_mx.pMsgMutex(), MMS_CONTEXT_INVOKE_WAIT_TIME);
g_mx.unlock();
MSG_INFO("## WAITING UNTIL __connection_profile_state CONNECT. ##");
- time_ret = cv.timedwait(mx.pMutex(), MMS_CONNECTION_API_WAIT_TIME); /* isCmOpened will changed by processCBdatas */
+ time_ret = cv.timedwait(mx.pMsgMutex(), MMS_CONNECTION_API_WAIT_TIME); /* isCmOpened will changed by processCBdatas */
if (time_ret == ETIMEDOUT) {
MSG_WARN("## WAKE by timeout ##");
MSG_INFO("## WAITING UNTIL connection_profile_close_callback ##");
- time_ret = cv.timedwait(mx.pMutex(), MMS_CONNECTION_API_WAIT_TIME);
+ time_ret = cv.timedwait(mx.pMsgMutex(), MMS_CONNECTION_API_WAIT_TIME);
if (time_ret == ETIMEDOUT) {
MSG_WARN("## WAKE by timeout ##");
{
/* bool bStart = true; */
- MutexLocker lock(mx);
+ MsgMutexLocker lock(mx);
if (!running) {
running = true;
char *interface_name;
char *proxy_address;
char *dns_address_list;
- Mutex mx;
- CndVar cv;
+ MsgMutex mx;
+ MsgCndVar cv;
};
#endif /* MMS_PLUGIN_CONNMAN_H */
MMS_HTTP_ERROR_E httpRequest(http_request_info_s &request_info);
void setAbortFlag(){
- MutexLocker locker(mx);
+ MsgMutexLocker locker(mx);
abort = true;
};
bool getAbortFlag(){
- MutexLocker locker(mx);
+ MsgMutexLocker locker(mx);
return abort;
};
void clearSession();
void initAbortFlag(){
- MutexLocker locker(mx);
+ MsgMutexLocker locker(mx);
abort = false;
};
FILE *respfile;
bool abort;
- Mutex mx;
+ MsgMutex mx;
};
#endif /* MMS_PLUGIN_HTTP_H */
void lock() { mx.lock(); }
void unlock() { mx.unlock(); }
- void wait() { cv.wait(mx.pMutex()); }
+ void wait() { cv.wait(mx.pMsgMutex()); }
void signal() { cv.signal(); }
private:
static MmsPluginUaManager *pInstance;
virtual void run();
- Mutex mx;
- CndVar cv;
+ MsgMutex mx;
+ MsgCndVar cv;
MMS_NET_ERROR_T submitHandler(mmsTranQEntity *qEntity);
MMS_NET_ERROR_T waitingConf(mmsTranQEntity *qEntity);
mx.lock();
- ret = cv.timedwait(mx.pMutex(), 25);
+ ret = cv.timedwait(mx.pMsgMutex(), 25);
if (ret == ETIMEDOUT) {
MSG_DEBUG("WARNING: DEVICE STATUS TIME-OUT");
GDBusProxy *gdbus_proxy = NULL;
gint subs_id = 0;
-Mutex mx;
-CndVar cv;
+MsgMutex mx;
+MsgCndVar cv;
void MsgResourceMonitorInit(void);
mx.lock();
bTapiResult = false;
- ret = cv.timedwait(mx.pMutex(), 25);
+ ret = cv.timedwait(mx.pMsgMutex(), 25);
mx.unlock();
mx.lock();
- ret = cv.timedwait(mx.pMutex(), 25);
+ ret = cv.timedwait(mx.pMsgMutex(), 25);
mx.unlock();
mx.lock();
- ret = cv.timedwait(mx.pMutex(), 25);
+ ret = cv.timedwait(mx.pMsgMutex(), 25);
mx.unlock();
int ret = 0;
if (curStatus == SMS_NETWORK_SENDING)
- ret = cv.timedwait(mx.pMutex(), 125);
+ ret = cv.timedwait(mx.pMsgMutex(), 125);
mx.unlock();
MSG_DEBUG("invoking service proxy call failed: %s\n", error->message);
goto _DBUS_ERROR;
}
- Mutex mx;
- CndVar cv;
+ MsgMutex mx;
+ MsgCndVar cv;
mx.lock();
- cv.timedwait(mx.pMutex(), 2);
+ cv.timedwait(mx.pMsgMutex(), 2);
mx.unlock();
MSG_END();
}
bool devStatus;
bool bNeedInitConfig;
- Mutex mx;
- CndVar cv;
+ MsgMutex mx;
+ MsgCndVar cv;
vector<sms_wap_info_s> wapList;
void convertDeliverMsgToMsgInfo(sms_telesvc_deliver_s *p_deliver, MSG_MESSAGE_INFO_S *p_msg_info);
char meImei[MAX_ME_IMEI_LEN + 1];
- Mutex mx;
- CndVar cv;
+ MsgMutex mx;
+ MsgCndVar cv;
};
#endif /* SMS_CDMA_PLUGIN_SETTING_H */
sms_network_status_t curStatus;
- Mutex mx;
- CndVar cv;
+ MsgMutex mx;
+ MsgCndVar cv;
};
#endif /* SMS_PLUGIN_TRANSPORT_H */
~SmsPluginUAManager();
void lock() { mx.lock(); };
void unlock() { mx.unlock(); };
- void wait() { cv.wait(mx.pMutex()); };
+ void wait() { cv.wait(mx.pMsgMutex()); };
void signal() { cv.signal(); };
virtual void run();
MsgSimpleQ <sms_request_info_s> smsTranQ;
- Mutex mx;
- CndVar cv;
+ MsgMutex mx;
+ MsgCndVar cv;
};
#endif /* SMS_CDMA_PLUGIN_UA_MANAGER_H */
mx.lock();
devHandle = handle;
- ret = cv.timedwait(mx.pMutex(), MAX_TAPI_SIM_API_TIMEOUT);
+ ret = cv.timedwait(mx.pMsgMutex(), MAX_TAPI_SIM_API_TIMEOUT);
if (ret == ETIMEDOUT) {
MSG_WARN("WARNING: DEVICE STATUS TIME-OUT");
bool isMemAvailable = true;
-Mutex mx;
-CndVar cv;
+MsgMutex mx;
+MsgCndVar cv;
void MsgResourceMonitorInit(void);
void* SmsPluginSetting::initSimInfo(void *data)
{
- static Mutex mm;
- MutexLocker lock(mm);
+ static MsgMutex mm;
+ MsgMutexLocker lock(mm);
instance()->processInitSimInfo(data);
{
MSG_BEGIN();
- MutexLocker lock(mx);
+ MsgMutexLocker lock(mx);
TelSmsParams_t smsParam = {0};
{
MSG_BEGIN();
- MutexLocker lock(mx);
+ MsgMutexLocker lock(mx);
int ret = TAPI_API_SUCCESS;
MSG_SIM_STATUS_T simStatus = MSG_SIM_STATUS_NOT_FOUND;
for (int i = 1; i <= simCnt; i++) {
- MutexLocker lock(mx);
+ MsgMutexLocker lock(mx);
memset(keyName, 0x00, sizeof(keyName));
snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_CHANGED, i);
MSG_DEBUG("SIM Index = [0], Set CB Receive is done");
return true;
} else {
- MutexLocker lock(mx);
+ MsgMutexLocker lock(mx);
handle = SmsPluginDSHandler::instance()->getTelHandle(pCbOpt->simIndex);
void SmsPluginSetting::setVoiceMailInfo(const MSG_VOICEMAIL_OPT_S *pVoiceOpt)
{
MSG_BEGIN();
- MutexLocker lock(mx);
+ MsgMutexLocker lock(mx);
int ret = TAPI_API_SUCCESS;
bool *bShowError = NULL; /* When invalid voicemail data exists on SIM, update error should not be handled. */
bool SmsPluginSetting::getVoiceMailInfo(TapiHandle *handle)
{
- MutexLocker lock(mx);
+ MsgMutexLocker lock(mx);
int ret = TAPI_API_SUCCESS;
bool SmsPluginSetting::getMwiInfo(TapiHandle *handle)
{
- MutexLocker lock(mx);
+ MsgMutexLocker lock(mx);
int ret = TAPI_API_SUCCESS;
bool SmsPluginSetting::getMsisdnInfo(TapiHandle *handle)
{
- MutexLocker lock(mx);
+ MsgMutexLocker lock(mx);
int ret = TAPI_API_SUCCESS;
bool SmsPluginSetting::getSimServiceTable(TapiHandle *handle)
{
- MutexLocker lock(mx);
+ MsgMutexLocker lock(mx);
int ret = TAPI_API_SUCCESS;
mx.lock();
- ret = cv.timedwait(mx.pMutex(), MAX_TAPI_SIM_API_TIMEOUT);
+ ret = cv.timedwait(mx.pMsgMutex(), MAX_TAPI_SIM_API_TIMEOUT);
mx.unlock();
mx.lock();
bTapiResult = false;
- ret = cv.timedwait(mx.pMutex(), MAX_TAPI_SIM_API_TIMEOUT);
+ ret = cv.timedwait(mx.pMsgMutex(), MAX_TAPI_SIM_API_TIMEOUT);
mx.unlock();
mx.lock();
bTapiResult = false;
- ret = cv.timedwait(mx.pMutex(), MAX_TAPI_SIM_API_TIMEOUT);
+ ret = cv.timedwait(mx.pMsgMutex(), MAX_TAPI_SIM_API_TIMEOUT);
mx.unlock();
mx.lock();
bTapiResult = false;
- ret = cv.timedwait(mx.pMutex(), MAX_TAPI_SIM_API_TIMEOUT);
+ ret = cv.timedwait(mx.pMsgMutex(), MAX_TAPI_SIM_API_TIMEOUT);
mx.unlock();
mx.lock();
- ret = cv.timedwait(mx.pMutex(), MAX_TAPI_SIM_API_TIMEOUT);
+ ret = cv.timedwait(mx.pMsgMutex(), MAX_TAPI_SIM_API_TIMEOUT);
mx.unlock();
MSG_DEBUG("getResultFromSim() is called .");
- ret = cv.timedwait(mx.pMutex(), MAX_TAPI_SIM_API_TIMEOUT);
+ ret = cv.timedwait(mx.pMsgMutex(), MAX_TAPI_SIM_API_TIMEOUT);
if (ret == ETIMEDOUT) {
MSG_DEBUG("WARNING: TAPI callback TIME-OUT");
mx.lock();
- ret = cv.timedwait(mx.pMutex(), 10);
+ ret = cv.timedwait(mx.pMsgMutex(), 10);
mx.unlock();
mx.lock();
bTapiResult = false;
- ret = cv.timedwait(mx.pMutex(), 10);
+ ret = cv.timedwait(mx.pMsgMutex(), 10);
mx.unlock();
mx.lock();
bTapiResult = false;
- ret = cv.timedwait(mx.pMutex(), 10);
+ ret = cv.timedwait(mx.pMsgMutex(), 10);
mx.unlock();
delSimMsgId = -1;
bTapiResult = false;
- ret = cv.timedwait(mx.pMutex(), 10);
+ ret = cv.timedwait(mx.pMsgMutex(), 10);
mx.unlock();
int ret = 0;
if (curStatus == SMS_NETWORK_SENDING)
- ret = cv.timedwait(mx.pMutex(), 125);
+ ret = cv.timedwait(mx.pMsgMutex(), 125);
mx.unlock();
int ret = 0;
- ret = cv.timedwait(mx.pMutex(), 10);
+ ret = cv.timedwait(mx.pMsgMutex(), 10);
mx.unlock();
goto _DBUS_ERROR;
}
- Mutex mx;
- CndVar cv;
+ MsgMutex mx;
+ MsgCndVar cv;
mx.lock();
- cv.timedwait(mx.pMutex(), 2);
+ cv.timedwait(mx.pMsgMutex(), 2);
mx.unlock();
MSG_END();
bool bUdhMwiMethod;
int udhMwiCnt;
- Mutex mx;
- CndVar cv;
+ MsgMutex mx;
+ MsgCndVar cv;
TapiHandle *devHandle;
};
bool bSMSPChanged;
bool bCBMIChanged;
- Mutex mx;
- CndVar cv;
+ MsgMutex mx;
+ MsgCndVar cv;
};
#endif /* SMS_PLUGIN_SAT_HANDLER_H */
bool bMbdnEnable[MAX_TELEPHONY_HANDLE_CNT];
- Mutex mx;
- CndVar cv;
+ MsgMutex mx;
+ MsgCndVar cv;
};
#endif /* SMS_PLUGIN_SETTING_H */
SMS_DATA_INFO_S simMsgDataInfo;
- Mutex mx;
- CndVar cv;
+ MsgMutex mx;
+ MsgCndVar cv;
};
#endif /* SMS_PLUGIN_SIMMSG_H */
SMS_NETWORK_STATUS_T curStatus;
TelSatMoSmCtrlIndData_t curMoCtrlData;
- Mutex mx;
- CndVar cv;
+ MsgMutex mx;
+ MsgCndVar cv;
};
#endif /* SMS_PLUGIN_TRANSPORT_H */
~SmsPluginUAManager();
void lock() { mx.lock(); };
void unlock() { mx.unlock(); };
- void wait() { cv.wait(mx.pMutex()); };
+ void wait() { cv.wait(mx.pMsgMutex()); };
void signal() { cv.signal(); };
virtual void run();
MsgSimpleQ <SMS_REQUEST_INFO_S> smsTranQ;
- Mutex mx;
- CndVar cv;
+ MsgMutex mx;
+ MsgCndVar cv;
};
#endif /* SMS_PLUGIN_UA_MANAGER_H */
int ret = 0;
/* Send Command to MSG FW */
- MutexLocker lock(mx);
+ MsgMutexLocker lock(mx);
ret = mClientSock.write(pCmdData, cmdSize);
if (ret < 0)
THROW(MsgException::IPC_ERROR, "IPC write error");
MsgProxyListener* MsgProxyListener::instance()
{
- static Mutex mm;
- MutexLocker lock(mm);
+ static MsgMutex mm;
+ MsgMutexLocker lock(mm);
if (!pInstance) {
pInstance = new MsgProxyListener();
void MsgProxyListener::start(MsgHandle* pMsgHandle)
{
- MutexLocker lock(mx);
+ MsgMutexLocker lock(mx);
this->insertOpenHandleSet(pMsgHandle);
{
MSG_BEGIN();
- MutexLocker lock(mx);
+ MsgMutexLocker lock(mx);
if (running > 1) {
running--;
bool MsgProxyListener::regSentStatusEventCB(MsgHandle* pMsgHandle, int fd, msg_sent_status_cb pfSentStatus, void *pUserParam)
{
- MutexLocker lock(mx);
+ MsgMutexLocker lock(mx);
std::list<MSG_SENT_STATUS_CB_ITEM_S>::iterator it = sentStatusCBList.begin();
bool MsgProxyListener::regMessageIncomingEventCB(MsgHandle* pMsgHandle, int fd, msg_sms_incoming_cb pfNewMessage, int port, void *pUserParam)
{
- MutexLocker lock(mx);
+ MsgMutexLocker lock(mx);
std::list<MSG_INCOMING_CB_ITEM_S>::iterator it = newMessageCBList.begin();
bool MsgProxyListener::regMMSConfMessageIncomingEventCB(MsgHandle* pMsgHandle, int fd, msg_mms_conf_msg_incoming_cb pfNewMMSConfMessage, const char *pAppId, void *pUserParam)
{
- MutexLocker lock(mx);
+ MsgMutexLocker lock(mx);
std::list<MSG_MMS_CONF_INCOMING_CB_ITEM_S>::iterator it = newMMSConfMessageCBList.begin();
bool MsgProxyListener::regPushMessageIncomingEventCB(MsgHandle* pMsgHandle, int fd, msg_push_msg_incoming_cb pfNewPushMessage, const char *pAppId, void *pUserParam)
{
- MutexLocker lock(mx);
+ MsgMutexLocker lock(mx);
std::list<MSG_PUSH_INCOMING_CB_ITEM_S>::iterator it = newPushMessageCBList.begin();
bool MsgProxyListener::regCBMessageIncomingEventCB(MsgHandle* pMsgHandle, int fd, msg_cb_incoming_cb pfNewCBMessage, bool bSave, void *pUserParam)
{
- MutexLocker lock(mx);
+ MsgMutexLocker lock(mx);
std::list<MSG_CB_INCOMING_CB_ITEM_S>::iterator it = newCBMessageCBList.begin();
bool MsgProxyListener::regReportMsgIncomingCB(MsgHandle* pMsgHandle, int fd, msg_report_msg_incoming_cb pfReportMessage, void *pUserParam)
{
- MutexLocker lock(mx);
+ MsgMutexLocker lock(mx);
std::list<MSG_REPORT_INCOMING_CB_ITEM_S>::iterator it = reportMessageCBList.begin();
bool MsgProxyListener::regSyncMLMessageIncomingEventCB(MsgHandle* pMsgHandle, int fd, msg_syncml_msg_incoming_cb pfNewSyncMLMessage, void *pUserParam)
{
- MutexLocker lock(mx);
+ MsgMutexLocker lock(mx);
std::list<MSG_SYNCML_INCOMING_CB_ITEM_S>::iterator it = newSyncMLMessageCBList.begin();
bool MsgProxyListener::regLBSMessageIncomingEventCB(MsgHandle* pMsgHandle, int fd, msg_lbs_msg_incoming_cb pfNewLBSMsgIncoming, void *pUserParam)
{
- MutexLocker lock(mx);
+ MsgMutexLocker lock(mx);
std::list<MSG_LBS_INCOMING_CB_ITEM_S>::iterator it = newLBSMessageCBList.begin();
bool MsgProxyListener::regSyncMLMessageOperationEventCB(MsgHandle* pMsgHandle, int fd, msg_syncml_msg_operation_cb pfSyncMLMessageOperation, void *pUserParam)
{
- MutexLocker lock(mx);
+ MsgMutexLocker lock(mx);
std::list<MSG_SYNCML_OPERATION_CB_ITEM_S>::iterator it = operationSyncMLMessageCBList.begin();
bool MsgProxyListener::regStorageChangeEventCB(MsgHandle* pMsgHandle, int fd, msg_storage_change_cb pfStorageChangeOperation, void *pUserParam)
{
- MutexLocker lock(mx);
+ MsgMutexLocker lock(mx);
std::list<MSG_STORAGE_CHANGE_CB_ITEM_S>::iterator it = storageChangeCBList.begin();
{
MSG_BEGIN();
- MutexLocker lock(mx);
+ MsgMutexLocker lock(mx);
/* sent status CB list */
std::list<MSG_SENT_STATUS_CB_ITEM_S>::iterator it = sentStatusCBList.begin();
{
MSG_BEGIN();
- MutexLocker lock(mx);
+ MsgMutexLocker lock(mx);
/* sent status CB list */
std::list<MSG_SENT_STATUS_CB_ITEM_S>::iterator it = sentStatusCBList.begin();
void MsgProxyListener::resetProxyListener()
{
MSG_DEBUG("client Listener reset");
- MutexLocker lock(mx);
+ MsgMutexLocker lock(mx);
if (channel) {
g_io_channel_unref(channel);
void MsgProxyListener::refreshProxyListener()
{
MSG_DEBUG("refresh proxy listener");
- MutexLocker lock(mx);
+ MsgMutexLocker lock(mx);
handle_set::iterator it = openHandleSet.begin();
for (; it != openHandleSet.end(); it++) {
{
MSG_DEBUG("try to insert opened handle. handle=[%p]", pMsgHandle);
- MutexLocker lock(mx);
+ MsgMutexLocker lock(mx);
handle_set::iterator it = openHandleSet.find(pMsgHandle);
if (it == openHandleSet.end()) {
typedef std::map<pthread_t, MsgDbHandler*> dbMap_t;
dbMap_t gDbHandles;
-Mutex mu;
+MsgMutex mu;
MsgDbHandler *getDbHandle()
{
dbMap_t::iterator it = gDbHandles.find(self);
if (it == gDbHandles.end()) {
MSG_DEBUG("New DB handle added.");
- MutexLocker locker(mu);
+ MsgMutexLocker locker(mu);
tmp = new MsgDbHandler();
gDbHandles.insert(std::pair<pthread_t, MsgDbHandler*>(self, tmp));
dbMap_t::iterator it = gDbHandles.find(self);
if (it != gDbHandles.end()) {
- MutexLocker locker(mu);
+ MsgMutexLocker locker(mu);
tmp = it->second;
delete tmp;
gDbHandles.erase(it);
#include <aul.h>
}
-Mutex g_mx;
-CndVar g_cv;
+MsgMutex g_mx;
+MsgCndVar g_cv;
void thumbnail_completed_cb(thumbnail_util_error_e error, const char *request_id,
int thumb_width, int thumb_height,
unsigned char *thumb_data, int thumb_size, void *user_data)
{
+ MSG_BEGIN();
+
+ g_mx.lock();
+
if (!user_data) {
MSG_WARN("dstPath is NULL");
+ g_cv.signal();
+ g_mx.unlock();
return;
}
- MSG_BEGIN();
-
- g_mx.lock();
MSG_DEBUG("=================[RESULT]");
MSG_DEBUG("error_code [%d]", error);
MSG_DEBUG("request id [%s]", request_id);
return false;
}
- time_ret = g_cv.timedwait(g_mx.pMutex(), 5);
+ time_ret = g_cv.timedwait(g_mx.pMsgMutex(), 5);
g_mx.unlock();