pal: Add mResourceManagerMutex to synchronize getTimestamp and getParameter

When getParameter call from ResourceManager and getTimestamp call from Stream Class
gets called simultaneously, both calls do mixer_set and mixer_get to get the data from
ADSP, and there is no synchronization between these calls, this can result in payload
mismatch in ADSP. As one call can do mixer_set first, then other call can also do
mixer_set which will override the payload updated by first call, and mixer_get
from first call can result in payload size mismatch in ADSP. To synchronize, mixer_set
and mixer_get call from these APIs, protect getTimeStamp with same mutex being used
by getParameter so that mixer_set and mixer_get from one call will be done at once.

Change-Id: If62c1dfc11dcbe9e5ff0f92a72031b4ebced82ac
2 files changed