Commit f8ac6bf161358b7eeea81c7a389ddd4d4ece1694

Use get_current_thread to retrieve the current thread object.
  
240240 /* It might be nice to do something with errors here. */
241241 internal_condition_case (invoke_thread_function, Qt, do_nothing);
242242
243 blocal_unbind_thread (current_thread);
243 blocal_unbind_thread (get_current_thread ());
244244
245245 /* Unlink this thread from the list of all threads. */
246246 for (iter = &all_threads; *iter != self; iter = &(*iter)->next_thread)