ICALL(ARRAY_13, "SetValueImpl", ves_icall_System_Array_SetValueImpl)
ICALL_TYPE(BUFFER, "System.Buffer", BUFFER_1)
-ICALL(BUFFER_1, "BlockCopyInternal", ves_icall_System_Buffer_BlockCopyInternal)
-ICALL(BUFFER_2, "ByteLengthInternal", ves_icall_System_Buffer_ByteLengthInternal)
-ICALL(BUFFER_3, "GetByteInternal", ves_icall_System_Buffer_GetByteInternal)
-ICALL(BUFFER_4, "SetByteInternal", ves_icall_System_Buffer_SetByteInternal)
+ICALL(BUFFER_1, "InternalBlockCopy", ves_icall_System_Buffer_BlockCopyInternal)
+ICALL(BUFFER_2, "_ByteLength", ves_icall_System_Buffer_ByteLengthInternal)
+ICALL(BUFFER_3, "_GetByte", ves_icall_System_Buffer_GetByteInternal)
+ICALL(BUFFER_4, "_SetByte", ves_icall_System_Buffer_SetByteInternal)
ICALL_TYPE (COMPO_W, "System.ComponentModel.Win32Exception", COMPO_W_1)
ICALL (COMPO_W_1, "W32ErrorMessage", ves_icall_System_ComponentModel_Win32Exception_W32ErrorMessage)
ICALL (SOCK_6a, "Disconnect_internal(intptr,bool,int&)", ves_icall_System_Net_Sockets_Socket_Disconnect_internal)
ICALL(SOCK_7, "GetSocketOption_arr_internal(intptr,System.Net.Sockets.SocketOptionLevel,System.Net.Sockets.SocketOptionName,byte[]&,int&)", ves_icall_System_Net_Sockets_Socket_GetSocketOption_arr_internal)
ICALL(SOCK_8, "GetSocketOption_obj_internal(intptr,System.Net.Sockets.SocketOptionLevel,System.Net.Sockets.SocketOptionName,object&,int&)", ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal)
+ ICALL(SOCK_21, "IOControl_internal(intptr,int,byte[],byte[],int&)", ves_icall_System_Net_Sockets_Socket_IOControl_internal)
ICALL(SOCK_9, "Listen_internal(intptr,int,int&)", ves_icall_System_Net_Sockets_Socket_Listen_internal)
ICALL(SOCK_10, "LocalEndPoint_internal(intptr,int,int&)", ves_icall_System_Net_Sockets_Socket_LocalEndPoint_internal)
ICALL(SOCK_11, "Poll_internal", ves_icall_System_Net_Sockets_Socket_Poll_internal)
+ ICALL(SOCK_13, "ReceiveFrom_internal(intptr,byte[],int,int,System.Net.Sockets.SocketFlags,System.Net.SocketAddress&,int&)", ves_icall_System_Net_Sockets_Socket_ReceiveFrom_internal)
ICALL(SOCK_11a, "Receive_internal(intptr,System.Net.Sockets.Socket/WSABUF[],System.Net.Sockets.SocketFlags,int&)", ves_icall_System_Net_Sockets_Socket_Receive_array_internal)
ICALL(SOCK_12, "Receive_internal(intptr,byte[],int,int,System.Net.Sockets.SocketFlags,int&)", ves_icall_System_Net_Sockets_Socket_Receive_internal)
- ICALL(SOCK_13, "RecvFrom_internal(intptr,byte[],int,int,System.Net.Sockets.SocketFlags,System.Net.SocketAddress&,int&)", ves_icall_System_Net_Sockets_Socket_RecvFrom_internal)
ICALL(SOCK_14, "RemoteEndPoint_internal(intptr,int,int&)", ves_icall_System_Net_Sockets_Socket_RemoteEndPoint_internal)
ICALL(SOCK_15, "Select_internal(System.Net.Sockets.Socket[]&,int,int&)", ves_icall_System_Net_Sockets_Socket_Select_internal)
- ICALL(SOCK_15a, "SendFile(intptr,string,byte[],byte[],System.Net.Sockets.TransmitFileOptions)", ves_icall_System_Net_Sockets_Socket_SendFile)
+ ICALL(SOCK_15a, "SendFile_internal(intptr,string,byte[],byte[],System.Net.Sockets.TransmitFileOptions)", ves_icall_System_Net_Sockets_Socket_SendFile_internal)
ICALL(SOCK_16, "SendTo_internal(intptr,byte[],int,int,System.Net.Sockets.SocketFlags,System.Net.SocketAddress,int&)", ves_icall_System_Net_Sockets_Socket_SendTo_internal)
ICALL(SOCK_16a, "Send_internal(intptr,System.Net.Sockets.Socket/WSABUF[],System.Net.Sockets.SocketFlags,int&)", ves_icall_System_Net_Sockets_Socket_Send_array_internal)
ICALL(SOCK_17, "Send_internal(intptr,byte[],int,int,System.Net.Sockets.SocketFlags,int&)", ves_icall_System_Net_Sockets_Socket_Send_internal)
ICALL(SOCK_18, "SetSocketOption_internal(intptr,System.Net.Sockets.SocketOptionLevel,System.Net.Sockets.SocketOptionName,object,byte[],int,int&)", ves_icall_System_Net_Sockets_Socket_SetSocketOption_internal)
ICALL(SOCK_19, "Shutdown_internal(intptr,System.Net.Sockets.SocketShutdown,int&)", ves_icall_System_Net_Sockets_Socket_Shutdown_internal)
ICALL(SOCK_20, "Socket_internal(System.Net.Sockets.AddressFamily,System.Net.Sockets.SocketType,System.Net.Sockets.ProtocolType,int&)", ves_icall_System_Net_Sockets_Socket_Socket_internal)
- ICALL(SOCK_21, "WSAIoctl(intptr,int,byte[],byte[],int&)", ves_icall_System_Net_Sockets_Socket_WSAIoctl)
ICALL(SOCK_21a, "cancel_blocking_socket_operation", icall_cancel_blocking_socket_operation)
ICALL(SOCK_22, "socket_pool_queue", icall_append_io_job)
ICALL(RT_2, "GetConstructors_internal", ves_icall_Type_GetConstructors_internal)
ICALL(RT_3, "GetEvents_internal", ves_icall_Type_GetEvents_internal)
ICALL(RT_5, "GetFields_internal", ves_icall_Type_GetFields_internal)
-ICALL(RT_6, "GetGenericArguments", ves_icall_MonoType_GetGenericArguments)
+ICALL(RT_6, "GetGenericArgumentsInternal", ves_icall_MonoType_GetGenericArguments)
ICALL(RT_7, "GetGenericParameterAttributes", ves_icall_Type_GetGenericParameterAttributes)
ICALL(RT_8, "GetGenericParameterConstraints_impl", ves_icall_Type_GetGenericParameterConstraints)
ICALL(RT_9, "GetGenericParameterPosition", ves_icall_Type_GetGenericParameterPosition)
#ifdef EPOOL_CLOEXEC
threadpool_io->epoll.fd = epoll_create1 (EPOLL_CLOEXEC);
#else
- threadpool_io->epoll.fd = epoll_create1 (256);
+ threadpool_io->epoll.fd = epoll_create (256);
fcntl (threadpool_io->epoll.fd, F_SETFD, FD_CLOEXEC);
#endif
io_status = STATUS_CLEANED_UP;
}
- gboolean
- mono_threadpool_ms_is_io (MonoObject *target, MonoObject *state)
+ static gboolean
+ is_socket_async_callback (MonoImage *system_image, MonoClass *class)
{
- static MonoClass *socket_class = NULL;
- static MonoClass *socket_async_class = NULL;
- static MonoClass *process_class = NULL;
- static MonoClass *async_read_handler_class = NULL;
- MonoClass *class;
- MonoSocketAsyncResult *sockares;
+ MonoClass *socket_async_callback_class = NULL;
- if (!mono_defaults.system)
- mono_defaults.system = mono_image_loaded ("System");
- if (!mono_defaults.system)
- return FALSE;
- g_assert (mono_defaults.system);
+ socket_async_callback_class = mono_class_from_name (system_image, "System.Net.Sockets", "SocketAsyncCallback");
+ g_assert (socket_async_callback_class);
- if (!socket_class)
- socket_class = mono_class_from_name (mono_defaults.system, "System.Net.Sockets", "Socket");
- g_assert (socket_class);
+ return class == socket_async_callback_class;
+ }
+
+ static gboolean
+ is_async_read_handler (MonoImage *system_image, MonoClass *class)
+ {
+ MonoClass *process_class = NULL;
- if (!process_class)
- process_class = mono_class_from_name (mono_defaults.system, "System.Diagnostics", "Process");
+ process_class = mono_class_from_name (system_image, "System.Diagnostics", "Process");
g_assert (process_class);
- class = target->vtable->klass;
+ return class->nested_in && class->nested_in == process_class && strcmp (class->name, "AsyncReadHandler") == 0;
+ }
- if (!socket_async_class) {
- if (class->nested_in && class->nested_in == socket_class && strcmp (class->name, "SocketAsyncCall") == 0)
- socket_async_class = class;
- }
+ gboolean
+ mono_threadpool_ms_is_io (MonoObject *target, MonoObject *state)
+ {
+ MonoImage *system_image;
+ MonoSocketAsyncResult *sockares;
- if (!async_read_handler_class) {
- if (class->nested_in && class->nested_in == process_class && strcmp (class->name, "AsyncReadHandler") == 0)
- async_read_handler_class = class;
- }
+ system_image = mono_image_loaded ("System");
+ if (!system_image)
+ return FALSE;
- if (class != socket_async_class && class != async_read_handler_class)
+ if (!is_socket_async_callback (system_image, target->vtable->klass) && !is_async_read_handler (system_image, target->vtable->klass))
return FALSE;
sockares = (MonoSocketAsyncResult*) state;
void
mono_threadpool_io_enqueue_socket_async_result (MonoDomain *domain, MonoSocketAsyncResult *sockares)
{
- static MonoClass *socket_runtime_work_item_class = NULL;
+ MonoImage *system_image;
+ MonoClass *socket_runtime_work_item_class;
MonoSocketRuntimeWorkItem *srwi;
g_assert (sockares);
- if (!mono_defaults.system)
- mono_defaults.system = mono_image_loaded ("System");
- g_assert (mono_defaults.system);
+ system_image = mono_image_loaded ("System");
+ g_assert (system_image);
- if (!socket_runtime_work_item_class)
- socket_runtime_work_item_class = mono_class_from_name (mono_defaults.system, "System.Net.Sockets", "MonoSocketRuntimeWorkItem");
+ socket_runtime_work_item_class = mono_class_from_name (system_image, "System.Net.Sockets", "MonoSocketRuntimeWorkItem");
g_assert (socket_runtime_work_item_class);
srwi = (MonoSocketRuntimeWorkItem*) mono_object_new (domain, socket_runtime_work_item_class);