From d2008573d560c748ff0cd9f2c3f5637a6c1f71ef Mon Sep 17 00:00:00 2001 From: Jay Krell Date: Tue, 3 Sep 2019 16:07:29 -0700 Subject: [PATCH] [Coop] ves_icall_System_IOSelector_Add Commit migrated from https://github.com/mono/mono/commit/350dd0e2de44a8ea0cfde38fdd3fb6747481e869 --- src/mono/mono/metadata/icall-def.h | 2 +- src/mono/mono/metadata/icall-table.h | 1 + src/mono/mono/metadata/threadpool-io.c | 9 ++++----- src/mono/mono/metadata/threadpool-io.h | 4 +--- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/mono/mono/metadata/icall-def.h b/src/mono/mono/metadata/icall-def.h index e8579ac..39bac41 100644 --- a/src/mono/mono/metadata/icall-def.h +++ b/src/mono/mono/metadata/icall-def.h @@ -459,7 +459,7 @@ ICALL_TYPE(IOPATH, "System.IO.Path", IOPATH_1) HANDLES(IOPATH_1, "get_temp_path", ves_icall_System_IO_get_temp_path, MonoString, 0, ()) ICALL_TYPE(IOSELECTOR, "System.IOSelector", IOSELECTOR_1) -ICALL(IOSELECTOR_1, "Add", ves_icall_System_IOSelector_Add) +HANDLES(IOSELECTOR_1, "Add", ves_icall_System_IOSelector_Add, void, 2, (gpointer, MonoIOSelectorJob)) NOHANDLES(ICALL(IOSELECTOR_2, "Remove", ves_icall_System_IOSelector_Remove)) ICALL_TYPE(MATH, "System.Math", MATH_19) diff --git a/src/mono/mono/metadata/icall-table.h b/src/mono/mono/metadata/icall-table.h index 26f6366..e4a2b82 100644 --- a/src/mono/mono/metadata/icall-table.h +++ b/src/mono/mono/metadata/icall-table.h @@ -207,6 +207,7 @@ typedef MonoStringHandle MonoStringOutHandle; #define MONO_HANDLE_TYPE_WRAP_MonoReflectionDynamicMethod ICALL_HANDLES_WRAP_OBJ #define MONO_HANDLE_TYPE_WRAP_MonoException ICALL_HANDLES_WRAP_OBJ #define MONO_HANDLE_TYPE_WRAP_MonoInternalThread ICALL_HANDLES_WRAP_OBJ +#define MONO_HANDLE_TYPE_WRAP_MonoIOSelectorJob ICALL_HANDLES_WRAP_OBJ #define MONO_HANDLE_TYPE_WRAP_MonoObject ICALL_HANDLES_WRAP_OBJ #define MONO_HANDLE_TYPE_WRAP_MonoManifestResourceInfo ICALL_HANDLES_WRAP_OBJ #define MONO_HANDLE_TYPE_WRAP_MonoMulticastDelegate ICALL_HANDLES_WRAP_OBJ diff --git a/src/mono/mono/metadata/threadpool-io.c b/src/mono/mono/metadata/threadpool-io.c index 3aee5b7..1a625ec 100644 --- a/src/mono/mono/metadata/threadpool-io.c +++ b/src/mono/mono/metadata/threadpool-io.c @@ -600,9 +600,9 @@ mono_threadpool_io_cleanup (void) } void -ves_icall_System_IOSelector_Add (gpointer handle, MonoIOSelectorJob *job) +ves_icall_System_IOSelector_Add (gpointer handle, MonoIOSelectorJobHandle job_handle, MonoError* error) { - ERROR_DECL (error); + MonoIOSelectorJob* const job = MONO_HANDLE_RAW (job_handle); ThreadPoolIOUpdate *update; g_assert (handle); @@ -624,13 +624,12 @@ ves_icall_System_IOSelector_Add (gpointer handle, MonoIOSelectorJob *job) return; } - int fd = GPOINTER_TO_INT (handle); + int const fd = GPOINTER_TO_INT (handle); if (!threadpool_io->backend.can_register_fd (fd)) { mono_coop_mutex_unlock (&threadpool_io->updates_lock); mono_trace (G_LOG_LEVEL_WARNING, MONO_TRACE_IO_SELECTOR, "Could not register to wait for file descriptor %d", fd); mono_error_set_not_supported (error, "Could not register to wait for file descriptor %d", fd); - mono_error_set_pending_exception (error); return; } @@ -708,7 +707,7 @@ mono_threadpool_io_remove_domain_jobs (MonoDomain *domain) #else void -ves_icall_System_IOSelector_Add (gpointer handle, MonoIOSelectorJob *job) +ves_icall_System_IOSelector_Add (gpointer handle, MonoIOSelectorJobHandle job_handle, MonoError* error) { g_assert_not_reached (); } diff --git a/src/mono/mono/metadata/threadpool-io.h b/src/mono/mono/metadata/threadpool-io.h index a71a9f8..da75352 100644 --- a/src/mono/mono/metadata/threadpool-io.h +++ b/src/mono/mono/metadata/threadpool-io.h @@ -13,9 +13,7 @@ typedef struct _MonoIOSelectorJob MonoIOSelectorJob; -ICALL_EXPORT -void -ves_icall_System_IOSelector_Add (gpointer handle, MonoIOSelectorJob *job); +TYPED_HANDLE_DECL (MonoIOSelectorJob); ICALL_EXPORT void -- 2.7.4