Update pdecuda.cu

added engine state mutex and wrapped the appropriate access with lock/release code.