Reviewed-by: coleenp, eosterlund, jiangli
Use Thread::current_or_null and handle NULL result. Reviewed-by: coleenp
Reviewed-by: darcy, ihse