cpp version:

* add threadNum() and pendingTaskNum()
* namespace fix and function prototype changes