Include return codes for thread functions such as RESOURCE_ERROR, STACK_ERROR, PRIORITY_ERROR, etc in defines.h.