in reply to Return Type of threads->create

Please show us code that we can run that exhibits the problem you encounter. The error message means that $thrObj has undef as value when you call $thrObj->tid(). So somewhere further up in the call chain, you are losing the value.