Fix race in DAP startup

Internal AdaCore DAP testing on Windows has had occasional failures
that show:

    assert threading.current_thread() is _dap_thread

I think this is a race in DAP startup: the _dap_thread global is only
set on return from start_thread, but it seems possible that the thread
itself could already run and encounter a @in_dap_thread decorator.

This patch fixes the problem by setting the global before running any
of the code in the new thread.  This also lets us remove a FIXME.



2 files changed