This patch introduces locks in trunk dynamic workloads, to prevent the same trunk from being used by multiple functions simultaneously. Change-Id: Iccc17f79a4b8192ca900f87d8e5182e6e4a4ce67