Is it, the error, more like defining reference object within thread? I did it, defining ref object, with thread primitive and all I got was executable crash. Only after I defined the ref object in main thread, it could be used for another thread.
I haven't tried threadpool though.
