Author: gonzalo
Date: 2005-04-07 20:20:20 -0400 (Thu, 07 Apr 2005)
New Revision: 42669
Modified:
trunk/mono/mono/metadata/ChangeLog
trunk/mono/mono/metadata/file-io.c
trunk/mono/mono/metadata/file-io.h
trunk/mono/mono/metadata/icall.c
trunk/mono/mono/metadata/socket-io.c
trunk/mono/mono/metadata/threadpool.c
trunk/mono/mono/metadata/threadpool.h
Log:
2005-04-07 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
* file-io.c:
* file-io.h:
* threadpool.c:
* threadpool.h:
* icall.c:
* socket-io.c: removed dead code for async IO.
Modified: trunk/mono/mono/metadata/ChangeLog
===================================================================
--- trunk/mono/mono/metadata/ChangeLog 2005-04-08 00:17:59 UTC (rev 42668)
+++ trunk/mono/mono/metadata/ChangeLog 2005-04-08 00:20:20 UTC (rev 42669)
@@ -1,5 +1,14 @@
2005-04-07 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
+ * file-io.c:
+ * file-io.h:
+ * threadpool.c:
+ * threadpool.h:
+ * icall.c:
+ * socket-io.c: removed dead code for async IO.
+
+2005-04-07 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
+
* socket-io.h: 2 more fields in MonoSocketAsyncResult.
* threadpool.c: intercept socket async. calls and pass them to a thread
Modified: trunk/mono/mono/metadata/file-io.c
===================================================================
--- trunk/mono/mono/metadata/file-io.c 2005-04-08 00:17:59 UTC (rev 42668)
+++ trunk/mono/mono/metadata/file-io.c 2005-04-08 00:20:20 UTC (rev 42669)
@@ -14,18 +14,6 @@
#include <signal.h>
#include <unistd.h>
-#ifndef PLATFORM_WIN32
-#ifdef HAVE_AIO_H
-#include <aio.h>
-#define USE_AIO 1
-#elif defined(HAVE_SYS_AIO_H)
-#include <sys/aio.h>
-#define USE_AIO 1
-#else
-#undef USE_AIO
-#endif
-#endif
-
#include <mono/metadata/object.h>
#include <mono/io-layer/io-layer.h>
#include <mono/metadata/file-io.h>
@@ -918,73 +906,6 @@
return(ret);
}
-/*
- * Asynchronous IO
- */
-MonoBoolean
-ves_icall_System_IO_MonoIO_GetSupportsAsync (void)
-{
- MONO_ARCH_SAVE_REGS;
-
-#ifdef PLATFORM_WIN32
- /* Seems like BindIoCompletionCallback is not found when compiling...
- * Disabling AIO support on win. Any one wants to fix this?
- */
- return FALSE;
- /* return (g_getenv ("MONO_DISABLE_AIO") == NULL && WINVER >= 0x500); */
-#elif defined(USE_AIO)
- return FALSE;
- /* Disabled. See bug 73718. We can enable this again if we have
- * a thread that handles socket/file IO
- *
- if (aio_cancel (-1, NULL) == -1 && errno == ENOSYS)
- return FALSE;
-
- return (g_getenv ("MONO_DISABLE_AIO") == NULL);
- */
-#else
- return FALSE;
-#endif
-}
-
-static WapiOverlapped *
-get_overlapped_from_fsa (MonoFSAsyncResult *ares)
-{
- WapiOverlapped *ovl;
-
- ovl = g_new0 (WapiOverlapped, 1);
- ovl->Offset = ares->offset;
- ovl->hEvent = ares->wait_handle;
-
- return ovl;
-}
-
-MonoBoolean
-ves_icall_System_IO_MonoIO_BeginRead (HANDLE handle, MonoFSAsyncResult *ares)
-{
- guint32 bytesread;
- WapiOverlapped *ovl;
-
- MONO_ARCH_SAVE_REGS;
-
- ovl = get_overlapped_from_fsa (ares);
- ovl->handle1 = ares;
- return ReadFile (handle, mono_array_addr (ares->buffer, gchar,
ares->offset), ares->count, &bytesread, ovl);
-}
-
-MonoBoolean
-ves_icall_System_IO_MonoIO_BeginWrite (HANDLE handle, MonoFSAsyncResult *ares)
-{
- guint32 byteswritten;
- WapiOverlapped *ovl;
-
- MONO_ARCH_SAVE_REGS;
-
- ovl = get_overlapped_from_fsa (ares);
- ovl->handle1 = ares;
- return WriteFile (handle, mono_array_addr (ares->buffer, gchar,
ares->offset), ares->count, &byteswritten, ovl);
-}
-
void ves_icall_System_IO_MonoIO_Lock (HANDLE handle, gint64 position,
gint64 length, gint32 *error)
{
Modified: trunk/mono/mono/metadata/file-io.h
===================================================================
--- trunk/mono/mono/metadata/file-io.h 2005-04-08 00:17:59 UTC (rev 42668)
+++ trunk/mono/mono/metadata/file-io.h 2005-04-08 00:20:20 UTC (rev 42669)
@@ -95,21 +95,6 @@
MonoDelegate *real_cb;
} MonoFSAsyncResult;
-#ifdef PLATFORM_WIN32
-typedef struct _WapiOverlapped WapiOverlapped;
-
-struct _WapiOverlapped
-{
- guint32 Internal;
- guint32 InternalHigh;
- guint32 Offset;
- guint32 OffsetHigh;
- gpointer hEvent;
- gpointer handle1;
- gpointer handle2;
-};
-#endif
-
/* System.IO.MonoIO */
extern MonoBoolean
@@ -229,15 +214,6 @@
extern gint32
ves_icall_System_IO_MonoIO_GetTempPath (MonoString **mono_name);
-extern MonoBoolean
-ves_icall_System_IO_MonoIO_GetSupportsAsync (void);
-
-extern MonoBoolean
-ves_icall_System_IO_MonoIO_BeginRead (HANDLE handle, MonoFSAsyncResult *ares);
-
-extern MonoBoolean
-ves_icall_System_IO_MonoIO_BeginWrite (HANDLE handle, MonoFSAsyncResult *ares);
-
extern void ves_icall_System_IO_MonoIO_Lock (HANDLE handle, gint64 position,
gint64 length, gint32 *error);
extern void ves_icall_System_IO_MonoIO_Unlock (HANDLE handle, gint64 position,
Modified: trunk/mono/mono/metadata/icall.c
===================================================================
--- trunk/mono/mono/metadata/icall.c 2005-04-08 00:17:59 UTC (rev 42668)
+++ trunk/mono/mono/metadata/icall.c 2005-04-08 00:20:20 UTC (rev 42669)
@@ -6060,8 +6060,6 @@
};
static const IcallEntry monoio_icalls [] = {
- {"BeginRead", ves_icall_System_IO_MonoIO_BeginRead },
- {"BeginWrite", ves_icall_System_IO_MonoIO_BeginWrite },
{"Close(intptr,System.IO.MonoIOError&)",
ves_icall_System_IO_MonoIO_Close},
{"CopyFile(string,string,bool,System.IO.MonoIOError&)",
ves_icall_System_IO_MonoIO_CopyFile},
{"CreateDirectory(string,System.IO.MonoIOError&)",
ves_icall_System_IO_MonoIO_CreateDirectory},
@@ -6076,7 +6074,6 @@
{"GetFileStat(string,System.IO.MonoIOStat&,System.IO.MonoIOError&)",
ves_icall_System_IO_MonoIO_GetFileStat},
{"GetFileType(intptr,System.IO.MonoIOError&)",
ves_icall_System_IO_MonoIO_GetFileType},
{"GetLength(intptr,System.IO.MonoIOError&)",
ves_icall_System_IO_MonoIO_GetLength},
- {"GetSupportsAsync", ves_icall_System_IO_MonoIO_GetSupportsAsync},
{"GetTempPath(string&)", ves_icall_System_IO_MonoIO_GetTempPath},
{"Lock(intptr,long,long,System.IO.MonoIOError&)",
ves_icall_System_IO_MonoIO_Lock},
{"MoveFile(string,string,System.IO.MonoIOError&)",
ves_icall_System_IO_MonoIO_MoveFile},
@@ -6310,7 +6307,6 @@
{"Connect_internal(intptr,System.Net.SocketAddress,int&)",
ves_icall_System_Net_Sockets_Socket_Connect_internal},
{"GetSocketOption_arr_internal(intptr,System.Net.Sockets.SocketOptionLevel,System.Net.Sockets.SocketOptionName,byte[]&,int&)",
ves_icall_System_Net_Sockets_Socket_GetSocketOption_arr_internal},
{"GetSocketOption_obj_internal(intptr,System.Net.Sockets.SocketOptionLevel,System.Net.Sockets.SocketOptionName,object&,int&)",
ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal},
- {"GetSupportsAsync", ves_icall_System_IO_MonoIO_GetSupportsAsync},
{"Listen_internal(intptr,int,int&)",
ves_icall_System_Net_Sockets_Socket_Listen_internal},
{"LocalEndPoint_internal(intptr,int&)",
ves_icall_System_Net_Sockets_Socket_LocalEndPoint_internal},
{"Poll_internal", ves_icall_System_Net_Sockets_Socket_Poll_internal},
@@ -6603,7 +6599,6 @@
};
static const IcallEntry threadpool_icalls [] = {
- {"BindHandleInternal",
ves_icall_System_Threading_ThreadPool_BindHandle},
{"GetAvailableThreads",
ves_icall_System_Threading_ThreadPool_GetAvailableThreads},
{"GetMaxThreads", ves_icall_System_Threading_ThreadPool_GetMaxThreads},
{"GetMinThreads", ves_icall_System_Threading_ThreadPool_GetMinThreads},
Modified: trunk/mono/mono/metadata/socket-io.c
===================================================================
--- trunk/mono/mono/metadata/socket-io.c 2005-04-08 00:17:59 UTC (rev
42668)
+++ trunk/mono/mono/metadata/socket-io.c 2005-04-08 00:20:20 UTC (rev
42669)
@@ -15,18 +15,6 @@
#include <unistd.h>
#include <errno.h>
-#ifndef PLATFORM_WIN32
-#ifdef HAVE_AIO_H
-#include <aio.h>
-#define USE_AIO 1
-#elif defined(HAVE_SYS_AIO_H)
-#include <sys/aio.h>
-#define USE_AIO 1
-#else
-#undef USE_AIO
-#endif
-#endif
-
#include <mono/metadata/object.h>
#include <mono/io-layer/io-layer.h>
#include <mono/metadata/socket-io.h>
Modified: trunk/mono/mono/metadata/threadpool.c
===================================================================
--- trunk/mono/mono/metadata/threadpool.c 2005-04-08 00:17:59 UTC (rev
42668)
+++ trunk/mono/mono/metadata/threadpool.c 2005-04-08 00:20:20 UTC (rev
42669)
@@ -788,33 +788,3 @@
g_free (overlapped);
}
-MonoBoolean
-ves_icall_System_Threading_ThreadPool_BindHandle (gpointer handle)
-{
- MONO_ARCH_SAVE_REGS;
-
-#ifdef PLATFORM_WIN32
- return FALSE;
-#else
- if (!BindIoCompletionCallback (handle, overlapped_callback, 0)) {
- gint error = GetLastError ();
- MonoException *exc;
- gchar *msg;
-
- if (error == ERROR_INVALID_PARAMETER) {
- exc = mono_get_exception_argument (NULL, "Invalid
parameter.");
- } else {
- msg = g_strdup_printf ("Win32 error %d.", error);
- exc = mono_exception_from_name_msg
(mono_defaults.corlib,
- "System",
-
"ApplicationException", msg);
- g_free (msg);
- }
-
- mono_raise_exception (exc);
- }
-
- return TRUE;
-#endif
-}
-
Modified: trunk/mono/mono/metadata/threadpool.h
===================================================================
--- trunk/mono/mono/metadata/threadpool.h 2005-04-08 00:17:59 UTC (rev
42668)
+++ trunk/mono/mono/metadata/threadpool.h 2005-04-08 00:20:20 UTC (rev
42669)
@@ -35,7 +35,4 @@
ves_icall_System_Threading_ThreadPool_SetMinThreads (gint workerThreads,
gint
completionPortThreads);
-MonoBoolean
-ves_icall_System_Threading_ThreadPool_BindHandle (gpointer handle);
-
#endif
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches