Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormonojenkins <jo.shields+jenkins@xamarin.com>2021-07-15 19:35:56 +0300
committerGitHub <noreply@github.com>2021-07-15 19:35:56 +0300
commit78c2b8da29881eccda4c27ca7b2b7e9ed451c55f (patch)
tree647e914a3e734f0bae4c165911be14faaa4a3c30
parent8dba54da1a85a55a7063945dec0c891b0c31e810 (diff)
[sgen] Transition to GC Unsafe in mono_gc_wait_for_bridge_processing (#21157)
Mark it as an external only API. In the runtime, use `mono_gc_wait_for_bridge_processing_internal` Co-authored-by: lambdageek <lambdageek@users.noreply.github.com>
-rw-r--r--mono/metadata/sgen-bridge.c13
-rw-r--r--mono/metadata/sgen-bridge.h2
-rw-r--r--mono/metadata/sgen-client-mono.h5
-rw-r--r--mono/metadata/sgen-mono.c2
4 files changed, 19 insertions, 3 deletions
diff --git a/mono/metadata/sgen-bridge.c b/mono/metadata/sgen-bridge.c
index 18aa1c2c5a3..35146dd2d2e 100644
--- a/mono/metadata/sgen-bridge.c
+++ b/mono/metadata/sgen-bridge.c
@@ -55,6 +55,14 @@ volatile gboolean mono_bridge_processing_in_progress = FALSE;
void
mono_gc_wait_for_bridge_processing (void)
{
+ MONO_ENTER_GC_UNSAFE;
+ mono_gc_wait_for_bridge_processing_internal ();
+ MONO_EXIT_GC_UNSAFE;
+}
+
+void
+mono_gc_wait_for_bridge_processing_internal (void)
+{
if (!mono_bridge_processing_in_progress)
return;
@@ -738,6 +746,11 @@ mono_gc_wait_for_bridge_processing (void)
{
}
+void
+mono_gc_wait_for_bridge_processing_internal (void)
+{
+}
+
MonoGCBridgeObjectKind
sgen_bridge_class_kind (MonoClass *klass)
{
diff --git a/mono/metadata/sgen-bridge.h b/mono/metadata/sgen-bridge.h
index c131f306691..3f11c11bcb0 100644
--- a/mono/metadata/sgen-bridge.h
+++ b/mono/metadata/sgen-bridge.h
@@ -103,7 +103,7 @@ typedef struct {
*/
MONO_API void mono_gc_register_bridge_callbacks (MonoGCBridgeCallbacks *callbacks);
-MONO_API void mono_gc_wait_for_bridge_processing (void);
+MONO_API MONO_RT_EXTERNAL_ONLY void mono_gc_wait_for_bridge_processing (void);
MONO_END_DECLS
diff --git a/mono/metadata/sgen-client-mono.h b/mono/metadata/sgen-client-mono.h
index 211d9ed5549..f69e05904f6 100644
--- a/mono/metadata/sgen-client-mono.h
+++ b/mono/metadata/sgen-client-mono.h
@@ -250,10 +250,13 @@ sgen_client_bridge_processing_stw_step (void)
sgen_bridge_processing_stw_step ();
}
+void
+mono_gc_wait_for_bridge_processing_internal (void);
+
static void G_GNUC_UNUSED
sgen_client_bridge_wait_for_processing (void)
{
- mono_gc_wait_for_bridge_processing ();
+ mono_gc_wait_for_bridge_processing_internal ();
}
static void G_GNUC_UNUSED
diff --git a/mono/metadata/sgen-mono.c b/mono/metadata/sgen-mono.c
index efb3afbd799..a46bfd56796 100644
--- a/mono/metadata/sgen-mono.c
+++ b/mono/metadata/sgen-mono.c
@@ -2877,7 +2877,7 @@ sgen_client_ensure_weak_gchandles_accessible (void)
* should wait for bridge processing but would fail to do so.
*/
if (G_UNLIKELY (mono_bridge_processing_in_progress))
- mono_gc_wait_for_bridge_processing ();
+ mono_gc_wait_for_bridge_processing_internal ();
}
void*