add: support for the execution thread control

Hi,

I have already described my intention in pull request #780, but just realized that the I've pull-requested directly from the develop branch.