Skip to content

Commit b022c9b

Browse files
"Implement" OSSpecificSynchronizationContext icalls.
1 parent 5000ae3 commit b022c9b

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

mono/metadata/icall-def.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -935,6 +935,10 @@ HANDLES(ICALL(NATIVEC_3, "OpenEvent_internal(string,System.Security.AccessContro
935935
ICALL(NATIVEC_4, "ResetEvent_internal", ves_icall_System_Threading_Events_ResetEvent_internal)
936936
ICALL(NATIVEC_5, "SetEvent_internal", ves_icall_System_Threading_Events_SetEvent_internal)
937937

938+
ICALL_TYPE(OSSYNCCONTEXT, "System.Threading.OSSpecificSynchronizationContext", OSSYNCCONTEXT_1)
939+
HANDLES(ICALL(OSSYNCCONTEXT_1, "GetOSContext", ves_icall_System_Threading_OSSpecificSynchronizationContext_GetOSContext))
940+
ICALL(OSSYNCCONTEXT_2, "PostInternal", ves_icall_System_Threading_OSSpecificSynchronizationContext_PostInternal)
941+
938942
ICALL_TYPE(SEMA, "System.Threading.Semaphore", SEMA_1)
939943
ICALL(SEMA_1, "CreateSemaphore_internal(int,int,string,int&)", ves_icall_System_Threading_Semaphore_CreateSemaphore_internal)
940944
ICALL(SEMA_2, "OpenSemaphore_internal(string,System.Security.AccessControl.SemaphoreRights,int&)", ves_icall_System_Threading_Semaphore_OpenSemaphore_internal)

mono/metadata/icall.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8751,3 +8751,15 @@ mono_register_jit_icall (gconstpointer func, const char *name, MonoMethodSignatu
87518751
return mono_register_jit_icall_full (func, name, sig, no_wrapper, NULL);
87528752
}
87538753

8754+
MonoObjectHandle
8755+
ves_icall_System_Threading_OSSpecificSynchronizationContext_GetOSContext ()
8756+
{
8757+
return NULL_HANDLE;
8758+
}
8759+
8760+
void
8761+
ves_icall_System_Threading_OSSpecificSynchronizationContext_PostInternal (gpointer callback, gpointer arg)
8762+
{
8763+
/* This isn't actually reachable since ves_icall_System_Threading_OSSpecificSynchronizationContext_GetOSContext always returns NULL */
8764+
mono_set_pending_exception (mono_get_exception_not_implemented ("System.Threading.InteropServices.OSSpecificSynchronizationContext.PostInternal internal call is not implemented."));
8765+
}

mono/metadata/threads-types.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,4 +267,10 @@ mono_thread_internal_describe (MonoInternalThread *internal, GString *str);
267267
gboolean
268268
mono_thread_internal_is_current (MonoInternalThread *internal);
269269

270+
MonoObjectHandle
271+
ves_icall_System_Threading_OSSpecificSynchronizationContext_GetOSContext ();
272+
273+
void
274+
ves_icall_System_Threading_OSSpecificSynchronizationContext_PostInternal (gpointer callback, gpointer arg);
275+
270276
#endif /* _MONO_METADATA_THREADS_TYPES_H_ */

0 commit comments

Comments
 (0)