- Ignore event when other threads are sending something
Change-Id: I2eba4d0b9f49992dae5232173d68171b7aeb592b
Signed-off-by: Junghoon Park <jh9216.park@samsung.com>
rpc_port_parcel_h parcel_received;
int cmd = -1;
- g_rec_mutex_lock(&handle->mutex);
+ if (g_rec_mutex_trylock(&handle->mutex) == FALSE)
+ return;
rpc_port_parcel_create_from_port(&parcel_received, handle->port);
rpc_port_parcel_read_int32(parcel_received, &cmd);
if (cmd != ##_METHOD_Callback) {
int cmd;
rpc_port_parcel_h parcel_received;
- do {
- std::lock_guard<std::recursive_mutex> lock(l->mutex_);
- if (rpc_port_parcel_create_from_port(&parcel_received, l->port_) != 0)
- return;
- } while (false);
+ if (!l->mutex_.try_lock())
+ return;
+
+ if (rpc_port_parcel_create_from_port(&parcel_received, l->port_) != 0) {
+ l->mutex_.unlock();
+ return;
+ }
+ l->mutex_unlock();
rpc_port_parcel_read_int32(parcel_received, &cmd);
if (cmd != static_cast<int>(MethodId::__Callback)) {
rpc_port_parcel_destroy(parcel_received);