void erts_schedule_delete_node(ErlNode *enp) { ASSERT(enp != erts_this_node); if (enp != erts_this_node) { if (node_tab_delete_delay == 0) try_delete_node((void *) enp); else if (node_tab_delete_delay > 0) erts_start_timer_callback(node_tab_delete_delay, try_delete_node, (void *) enp); } }
void erts_set_this_node(Eterm sysname, Uint creation) { ERTS_SMP_LC_ASSERT(erts_thr_progress_is_blocking()); ASSERT(erts_refc_read(&erts_this_dist_entry->refc, 2)); if (erts_refc_dectest(&erts_this_node->refc, 0) == 0) try_delete_node(erts_this_node); if (erts_refc_dectest(&erts_this_dist_entry->refc, 0) == 0) try_delete_dist_entry(erts_this_dist_entry); erts_this_node = NULL; /* to make sure refc is bumped for this node */ erts_this_node = erts_find_or_insert_node(sysname, creation); erts_this_dist_entry = erts_this_node->dist_entry; erts_refc_inc(&erts_this_dist_entry->refc, 2); erts_this_node_sysname = erts_this_node_sysname_BUFFER; erts_snprintf(erts_this_node_sysname, sizeof(erts_this_node_sysname_BUFFER), "%T", sysname); }