thread names: coop, constants, usually ignore-error.
- 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/
0c6cb9fbc3f97e15acf6be07eb46c19a288b3937