semaphores.h \
sockets.h \
status.h \
- threads.h \
timefuncs.h \
types.h \
uglify.h \
socket-private.h \
socket-wrappers.h \
status.h \
- threads.h \
- thread-private.h \
timefuncs.c \
timefuncs.h \
timefuncs-private.h \
wapi_glob.c \
wapi.h \
wapi-private.h \
- wapi.c \
- wthreads.c
+ wapi.c
WINDOWS_H = \
#include <mono/io-layer/wapi-private.h>
#include <mono/io-layer/io-private.h>
#include <mono/io-layer/timefuncs-private.h>
-#include <mono/io-layer/thread-private.h>
#include <mono/io-layer/io-portability.h>
#include <mono/io-layer/io-trace.h>
#include <mono/utils/strenc.h>
#include <mono/io-layer/wapi.h>
#include <mono/io-layer/wapi-private.h>
#include <mono/io-layer/process-private.h>
-#include <mono/io-layer/threads.h>
#include <mono/io-layer/io-trace.h>
#include <mono/utils/strenc.h>
#include <mono/utils/mono-path.h>
#include <mono/utils/mono-logger-internals.h>
#include <mono/utils/w32handle.h>
+#define STILL_ACTIVE STATUS_PENDING
+
/* The process' environment strings */
#if defined(__APPLE__)
#if defined (TARGET_OSX)
+++ /dev/null
-/*
- * thread-private.h: Private definitions for thread handles
- *
- * Author:
- * Dick Porter (dick@ximian.com)
- *
- * (C) 2002 Ximian, Inc.
- */
-
-#ifndef _WAPI_THREAD_PRIVATE_H_
-#define _WAPI_THREAD_PRIVATE_H_
-
-#include <config.h>
-#include <glib.h>
-#include <pthread.h>
-
-#include "wapi-private.h"
-
-void
-_wapi_thread_init (void);
-
-extern void _wapi_thread_cleanup (void);
-
-#endif /* _WAPI_THREAD_PRIVATE_H_ */
+++ /dev/null
-/*
- * threads.h: Thread handles
- *
- * Author:
- * Dick Porter (dick@ximian.com)
- *
- * (C) 2002 Ximian, Inc.
- */
-
-#ifndef _WAPI_THREADS_H_
-#define _WAPI_THREADS_H_
-
-#include <glib.h>
-
-#include <pthread.h>
-
-#include <mono/io-layer/io.h>
-#include <mono/io-layer/status.h>
-#include <mono/io-layer/processes.h>
-#include <mono/io-layer/access.h>
-
-G_BEGIN_DECLS
-
-#define STILL_ACTIVE STATUS_PENDING
-
-#define THREAD_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3ff)
-
-typedef guint32 (*WapiThreadStart)(gpointer);
-
-typedef struct {
- pthread_t id;
- GPtrArray *owned_mutexes;
- gint32 priority;
-} MonoW32HandleThread;
-
-G_END_DECLS
-#endif /* _WAPI_THREADS_H_ */
typedef WapiSecurityAttributes *LPSECURITY_ATTRIBUTES;
typedef WapiOverlapped *LPOVERLAPPED;
typedef WapiOverlappedCB LPOVERLAPPED_COMPLETION_ROUTINE;
-typedef WapiThreadStart LPTHREAD_START_ROUTINE;
typedef WapiFileTime FILETIME;
typedef WapiFileTime *LPFILETIME;
typedef WapiSystemTime SYSTEMTIME;
#include <mono/utils/mono-os-mutex.h>
+/* There doesn't seem to be a defined symbol for this */
+#define _WAPI_THREAD_CURRENT (gpointer)0xFFFFFFFE
+
extern gboolean _wapi_has_shut_down;
typedef struct
#include <mono/io-layer/mutex-private.h>
#include <mono/io-layer/semaphore-private.h>
#include <mono/io-layer/socket-private.h>
-#include <mono/io-layer/thread-private.h>
#include <mono/io-layer/process-private.h>
#include <mono/utils/w32handle.h>
#include "wapi.h"
-#include "process-private.h"
-#include "thread-private.h"
+#include "event-private.h"
#include "io-trace.h"
+#include "io.h"
+#include "mutex-private.h"
+#include "process-private.h"
+#include "semaphore-private.h"
+#include "shared.h"
+#include "socket-private.h"
#include "mono/utils/mono-lazy-init.h"
#include "mono/utils/w32handle.h"
_wapi_shm_semaphores_init ();
_wapi_io_init ();
_wapi_processes_init ();
- _wapi_thread_init ();
_wapi_semaphore_init ();
_wapi_mutex_init ();
_wapi_event_init ();
_wapi_has_shut_down = TRUE;
_wapi_error_cleanup ();
- _wapi_thread_cleanup ();
wapi_processes_cleanup ();
_wapi_io_cleanup ();
}
#include <mono/io-layer/semaphores.h>
#include <mono/io-layer/sockets.h>
#include <mono/io-layer/status.h>
-#include <mono/io-layer/threads.h>
#include <mono/io-layer/timefuncs.h>
#include <mono/io-layer/versioninfo.h>
#include <mono/io-layer/wait.h>
+++ /dev/null
-/*
- * threads.c: Thread handles
- *
- * Author:
- * Dick Porter (dick@ximian.com)
- *
- * (C) 2002-2006 Ximian, Inc.
- * Copyright 2003-2011 Novell, Inc (http://www.novell.com)
- * Copyright 2011 Xamarin, Inc (http://www.xamarin.com)
- * Licensed under the MIT license. See LICENSE file in the project root for full license information.
- */
-
-#include <config.h>
-#include <stdio.h>
-#include <glib.h>
-#include <string.h>
-#include <pthread.h>
-#include <sched.h>
-#include <sys/time.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#include <mono/io-layer/wapi.h>
-#include <mono/io-layer/wapi-private.h>
-#include <mono/io-layer/thread-private.h>
-#include <mono/io-layer/mutex-private.h>
-#include <mono/io-layer/io-trace.h>
-
-#include <mono/utils/mono-threads.h>
-#include <mono/utils/atomic.h>
-#include <mono/utils/mono-time.h>
-#include <mono/utils/mono-once.h>
-#include <mono/utils/mono-logger-internals.h>
-#include <mono/utils/w32handle.h>
-
-#ifdef HAVE_VALGRIND_MEMCHECK_H
-#include <valgrind/memcheck.h>
-#endif
-
-void
-_wapi_thread_init (void)
-{
-}
-
-void
-_wapi_thread_cleanup (void)
-{
-}
mono_domain_assemblies_unlock (domain);
}
-static guint32 WINAPI
+static gsize WINAPI
unload_thread_main (void *arg)
{
MonoError error;
tp.priority = MONO_THREAD_PRIORITY_NORMAL;
tp.stack_size = 0;
tp.creation_flags = CREATE_SUSPENDED;
- thread_handle = mono_threads_create_thread ((LPTHREAD_START_ROUTINE)unload_thread_main, thread_data, &tp, &tid);
+ thread_handle = mono_threads_create_thread (unload_thread_main, thread_data, &tp, &tid);
if (thread_handle == NULL)
return;
mono_thread_info_resume (tid);
static void transport_connect (void);
-static guint32 WINAPI receiver_thread (void *arg);
+static gsize WINAPI receiver_thread (void *arg);
static void transport_start_receive (void);
g_assert (receiver_thread_handle);
}
-static guint32 WINAPI
+static gsize WINAPI
receiver_thread (void *arg)
{
MonoError error;
#ifdef HOST_WIN32
typedef SECURITY_ATTRIBUTES WapiSecurityAttributes;
-typedef LPTHREAD_START_ROUTINE WapiThreadStart;
#endif
typedef struct _MonoInternalThread MonoInternalThread;
return(0);
}
-static guint32 WINAPI start_wrapper(void *data)
+static gsize WINAPI start_wrapper(void *data)
{
volatile int dummy;
tp.stack_size = stack_size;
tp.creation_flags = CREATE_SUSPENDED;
- thread_handle = mono_threads_create_thread ((LPTHREAD_START_ROUTINE)start_wrapper, start_info, &tp, &tid);
+ thread_handle = mono_threads_create_thread (start_wrapper, start_info, &tp, &tid);
if (thread_handle == NULL) {
/* The thread couldn't be created, so set an exception */
InterlockedIncrement (&acfg->stats.ccount);
}
-static void
-compile_thread_main (gpointer *user_data)
+static gsize WINAPI
+compile_thread_main (gpointer user_data)
{
- MonoDomain *domain = (MonoDomain *)user_data [0];
- MonoAotCompile *acfg = (MonoAotCompile *)user_data [1];
- GPtrArray *methods = (GPtrArray *)user_data [2];
+ MonoDomain *domain = ((MonoDomain **)user_data) [0];
+ MonoAotCompile *acfg = ((MonoAotCompile **)user_data) [1];
+ GPtrArray *methods = ((GPtrArray **)user_data) [2];
int i;
MonoError error;
for (i = 0; i < methods->len; ++i)
compile_method (acfg, (MonoMethod *)g_ptr_array_index (methods, i));
+
+ return 0;
}
static void
tp.priority = MONO_THREAD_PRIORITY_NORMAL;
tp.stack_size = 0;
tp.creation_flags = 0;
- handle = mono_threads_create_thread ((LPTHREAD_START_ROUTINE)compile_thread_main, user_data, &tp, NULL);
+ handle = mono_threads_create_thread (compile_thread_main, (gpointer) user_data, &tp, NULL);
g_ptr_array_add (threads, handle);
}
g_free (methods);
static gboolean transport_handshake (void);
static void register_transport (DebuggerTransport *trans);
-static guint32 WINAPI debugger_thread (void *arg);
+static gsize WINAPI debugger_thread (void *arg);
static void runtime_initialized (MonoProfiler *prof);
* This thread handles communication with the debugger client using a JDWP
* like protocol.
*/
-static guint32 WINAPI
+static gsize WINAPI
debugger_thread (void *arg)
{
MonoError error;
void nacl_shutdown_gc_thread(void);
#endif
+typedef struct {
+ pthread_t id;
+ GPtrArray *owned_mutexes;
+ gint32 priority;
+} MonoW32HandleThread;
+
static gpointer
thread_handle_create (void)
{
}
HANDLE
-mono_threads_platform_create_thread (LPTHREAD_START_ROUTINE start_routine, gpointer arg, MonoThreadParm *tp, MonoNativeThreadId *out_tid)
+mono_threads_platform_create_thread (MonoThreadStart start_routine, gpointer arg, MonoThreadParm *tp, MonoNativeThreadId *out_tid)
{
pthread_attr_t attr;
int res;
}
HANDLE
-mono_threads_platform_create_thread (LPTHREAD_START_ROUTINE start_routine, gpointer arg, MonoThreadParm *tp, MonoNativeThreadId *out_tid)
+mono_threads_platform_create_thread (MonoThreadStart start_routine, gpointer arg, MonoThreadParm *tp, MonoNativeThreadId *out_tid)
{
ThreadStartInfo *start_info;
HANDLE result;
* Returns: a windows or io-layer handle for the thread.
*/
HANDLE
-mono_threads_create_thread (LPTHREAD_START_ROUTINE start, gpointer arg, MonoThreadParm *tp, MonoNativeThreadId *out_tid)
+mono_threads_create_thread (MonoThreadStart start, gpointer arg, MonoThreadParm *tp, MonoNativeThreadId *out_tid)
{
return mono_threads_platform_create_thread (start, arg, tp, out_tid);
}
#define MONO_NATIVE_THREAD_ID_TO_UINT(tid) (tid)
#define MONO_UINT_TO_NATIVE_THREAD_ID(tid) ((MonoNativeThreadId)(tid))
+typedef LPTHREAD_START_ROUTINE MonoThreadStart;
+
#else
#include <pthread.h>
#define MONO_NATIVE_THREAD_ID_TO_UINT(tid) (gsize)(tid)
#define MONO_UINT_TO_NATIVE_THREAD_ID(tid) (MonoNativeThreadId)(gsize)(tid)
+typedef gsize (*MonoThreadStart)(gpointer);
+
#endif /* #ifdef HOST_WIN32 */
/*
mono_thread_info_is_live (THREAD_INFO_TYPE *info);
HANDLE
-mono_threads_create_thread (LPTHREAD_START_ROUTINE start, gpointer arg, MonoThreadParm *tp, MonoNativeThreadId *out_tid);
+mono_threads_create_thread (MonoThreadStart start, gpointer arg, MonoThreadParm *tp, MonoNativeThreadId *out_tid);
int
mono_threads_get_max_stack_size (void);
void mono_threads_suspend_abort_syscall (THREAD_INFO_TYPE *info);
gboolean mono_threads_suspend_needs_abort_syscall (void);
-HANDLE mono_threads_platform_create_thread (LPTHREAD_START_ROUTINE start, gpointer arg, MonoThreadParm *, MonoNativeThreadId *out_tid);
+HANDLE mono_threads_platform_create_thread (MonoThreadStart start, gpointer arg, MonoThreadParm *, MonoNativeThreadId *out_tid);
void mono_threads_platform_resume_created (THREAD_INFO_TYPE *info, MonoNativeThreadId tid);
void mono_threads_platform_get_stack_bounds (guint8 **staddr, size_t *stsize);
gboolean mono_threads_platform_yield (void);