All existing safepoints appear to be mooted by pinned coop handles. (mono/mono#16695)
authorJay Krell <jaykrell@microsoft.com>
Tue, 17 Sep 2019 21:39:09 +0000 (14:39 -0700)
committerAlexander Köplinger <alex.koeplinger@outlook.com>
Tue, 17 Sep 2019 21:39:09 +0000 (23:39 +0200)
Perhaps they are never needed then.

Commit migrated from https://github.com/mono/mono/commit/12c48df242f61c6e028030499a43b140f41873e1

src/mono/mono/utils/mono-threads-api.h

index d053320..c8e3410 100644 (file)
@@ -144,6 +144,7 @@ mono_threads_enter_no_safepoints_region (const char *func);
 void
 mono_threads_exit_no_safepoints_region (const char *func);
 
+#if 0
 #define MONO_ENTER_NO_SAFEPOINTS                                               \
        do {                                                                            \
                do {                                                                    \
@@ -155,6 +156,14 @@ mono_threads_exit_no_safepoints_region (const char *func);
                if (mono_threads_are_safepoints_enabled ())                     \
                        mono_threads_exit_no_safepoints_region (__func__);      \
        } while (0)
+#else
+
+// With pinned handles, safepoints become not needed, as long as pinned handles are used.
+
+#define MONO_ENTER_NO_SAFEPOINTS   /* nothing */
+#define MONO_EXIT_NO_SAFEPOINTS    /* nothing */
+
+#endif
 
 MONO_API MONO_RT_EXTERNAL_ONLY void
 mono_thread_set_coop_aware (void);