Restore domain in error path. (#13662)
commit83acc1a3431c1eba1f911d9c82934ad9cbdffc36
authorJay Krell <jay.krell@cornell.edu>
Thu, 28 Mar 2019 06:20:53 +0000 (27 23:20 -0700)
committerZoltan Varga <vargaz@gmail.com>
Thu, 28 Mar 2019 06:20:53 +0000 (28 02:20 -0400)
tree4f85abec2f3a6b668db969d08ea0580fa7cf8d8e
parent3fae397cce86398d738026db8220ee6ddcbcd503
Restore domain in error path. (#13662)

* In mono_threadpool_enqueue_work_item, if mono_runtime_invoke_checked fails,
still restore domain.

In mono_threadpool_enqueue_work_item, acknowledge with a comment but do not change
that mono_domain_set failing leads to returning success.

In mono_threadpool_enqueue_work_item, refactor for sharing code without loss
of efficiency or hopefully clarity.

* Keep this line duplicated:
`mono_runtime_invoke_checked (unsafe_queue_custom_work_item_method, NULL, args, error);`
mono/metadata/threadpool.c