Merge "agm: Dump AudioHAL thread traces to logcat"
diff --git a/ipc/HwBinders/agm_ipc_client/src/agm_client_wrapper.cpp b/ipc/HwBinders/agm_ipc_client/src/agm_client_wrapper.cpp
index de56c56..520a2af 100644
--- a/ipc/HwBinders/agm_ipc_client/src/agm_client_wrapper.cpp
+++ b/ipc/HwBinders/agm_ipc_client/src/agm_client_wrapper.cpp
@@ -71,6 +71,7 @@
#include <agm/agm_api.h>
#include "inc/AGMCallback.h"
+#include <mutex>
using android::hardware::Return;
using android::hardware::hidl_vec;
@@ -91,6 +92,7 @@
sp<IAGMCallback> ClbkBinder = NULL;
static list_declare(client_clbk_data_list);
static pthread_mutex_t clbk_data_list_lock = PTHREAD_MUTEX_INITIALIZER;
+static std::mutex agm_session_register_cb_mutex;
struct client_cb_data {
struct listnode node;
@@ -730,6 +732,7 @@
int agm_session_register_cb(uint32_t session_id, agm_event_cb cb,
enum event_type evt_type, void *client_data)
{
+ std::lock_guard<std::mutex> lck(agm_session_register_cb_mutex);
ALOGV("%s : sess_id = %d, evt_type = %d, client_data = %p \n", __func__,
session_id, evt_type, client_data);
int32_t ret = 0;