void SharedState::after_fork_child(STATE, GCToken gct, CallFrame* call_frame) {
    // For now, we disable inline debugging here. This makes inspecting
    // it much less confusing.

    config.jit_inline_debug.set("no");

    env_->set_root_vm(state->vm());

    disable_metrics(state);

    reset_threads(state, gct, call_frame);

    // Reinit the locks for this object
    global_cache->reset();
    fork_exec_lock_.init();
    capi_ds_lock_.init();
    capi_locks_lock_.init();
    capi_constant_lock_.init();
    global_capi_handle_lock_.init();
    capi_handle_cache_lock_.init();
    llvm_state_lock_.init();
    vm_lock_.init();
    wait_lock_.init();
    type_info_lock_.init();
    code_resource_lock_.init();
    internal_threads_->init();

    om->after_fork_child(state);
    console_->after_fork_child(state);

    state->vm()->set_run_state(ManagedThread::eIndependent);
    gc_dependent(state, 0);
  }
Exemplo n.º 2
0
Player::~Player(){
	stop_threads();

	numthreads = 0;
	reset_threads(); //shut down the theads properly

	root.dealloc(ctmem);
	ctmem.compact();
}
Exemplo n.º 3
0
void Player::set_board(const Board & board){
	stop_threads();

	nodes -= root.dealloc(ctmem);
	root = Node();
	root.exp.addwins(visitexpand+1);

	rootboard = board;

	reset_threads(); //needed since the threads aren't started before a board it set

	if(ponder)
		start_threads();
}