thread names: coop, constants, usually ignore-error. (mono/mono#16272)
authorAlexander Köplinger <alex.koeplinger@outlook.com>
Mon, 19 Aug 2019 09:23:23 +0000 (11:23 +0200)
committerGitHub <noreply@github.com>
Mon, 19 Aug 2019 09:23:23 +0000 (11:23 +0200)
- Convert setting thread name to be coop-compatible.

- For constant thread names, just retain the constant, not a copy.
  This includes producing and using constant unicode thread names on Windows.

- Make setting a thread name often non-fatal, except where mandated by public API.

- From earlier PR: mono_free (mono-publib.c) would no longer be referenced and therefore
  no longer exported. That broke profilers and maybe other externals.
  Choices:
     1 Use it instead of g_free randomly sometimes.
     2 Call it randomly sometimes.
     3 include it in external-only.c or object.c
     4 Mark it external only (breaks profiler).
     5 Use a .def file or Unix equivalent.

     5 is best, 2 is done here, the advantages/disadvantages
     among most choices are subtle. 3 is probably better than 2
     but is slightly bigger change, to put off -- you'd stop
     compiling mono-publib.c and move it to include/extra_redist.

     The advantage of not-.def file is perhaps that it is exposed
     by the compiler, so maybe easy to port and work with.
     People are more comfortable with obscure C extensions than
     any linker options, and there are multiple linkers to contend
     with. Arguably there are fewer compilers.

Commit migrated from https://github.com/mono/mono/commit/9001c4fa83aa2327038627e9f003ce9432a8e8d5


Trivial merge