Does NVEnc with DXGI capture support multithread?

Hi:
I’m trying to modifying the NVENC sample(use DXGI capture desktop images in WIN10, and use NVENC to encode images to h265) to support multithread One thread for capture images, another thread to encode. But it doesn’t work, after processing some images, it will be tucked at some function call.
Stucked function calls include:
AcquireNextFrame
nvEncLockBitstream
nvEncUnlockBitstream
Does anyone know the reason and tell me, thanks.

Again,does anyone know?