Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDick Porter <dick@acm.org>2001-09-23 16:32:33 +0400
committerDick Porter <dick@acm.org>2001-09-23 16:32:33 +0400
commit70b4ec9404b6f0c8178172d320d36b95137f9c22 (patch)
treed0615acfd721a1be95beb2479f45495f34cd0508
parent879c3f3467e1022d0bb5e51bebb15d01198cb66e (diff)
2001-09-23 Dick Porter <dick@ximian.com>
* threads-dummy.c: * threads-dummy.h: New files of dummy threading routines * Makefile.am (THREAD_SOURCE): Arrange to compile different thread support code based on system specifics Rename PTHREAD_LIBS to THREAD_LIBS 2001-09-23 Dick Porter <dick@ximian.com> * configure.in: Arrange to compile dummy thread support routines if pthread isnt available 2001-09-23 Dick Porter <dick@ximian.com> * Makefile.am (testjit_LDADD): rename PTHREAD_LIBS to THREAD_LIBS 2001-09-23 Dick Porter <dick@ximian.com> * Makefile.am (mint_LDADD): rename PTHREAD_LIBS to THREAD_LIBS svn path=/trunk/mono/; revision=934
-rw-r--r--ChangeLog5
-rw-r--r--configure.in14
-rw-r--r--mono/interpreter/ChangeLog4
-rw-r--r--mono/interpreter/Makefile.am2
-rw-r--r--mono/jit/ChangeLog4
-rw-r--r--mono/jit/Makefile.am2
-rw-r--r--mono/metadata/ChangeLog10
-rw-r--r--mono/metadata/Makefile.am17
-rw-r--r--mono/metadata/threads-dummy.c56
-rw-r--r--mono/metadata/threads-dummy.h20
-rw-r--r--mono/metadata/threads.h5
11 files changed, 130 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 37f81814673..ce09ef5274a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2001-09-23 Dick Porter <dick@ximian.com>
+ * configure.in: Arrange to compile dummy thread support routines
+ if pthread isnt available
+
+2001-09-23 Dick Porter <dick@ximian.com>
+
* configure.in: Check for pthread.h, so that we can check for the
HAVE_PTHREAD_H define in config.h
diff --git a/configure.in b/configure.in
index 047c4b5fff7..2ecf6c455bf 100644
--- a/configure.in
+++ b/configure.in
@@ -37,9 +37,17 @@ dnl *****************************
dnl *** Checks for libpthread ***
dnl *****************************
AC_CHECK_HEADERS(pthread.h)
-AC_CHECK_LIB(pthread,pthread_create,PTHREAD_LIBS=-lpthread,
- AC_MSG_ERROR([Cannot find libpthread]))
-AC_SUBST(PTHREAD_LIBS)
+AC_CHECK_LIB(pthread, pthread_create, [
+ THREAD_LIBS=-lpthread
+ AM_CONDITIONAL(THREADS_PTHREAD, true)
+ ], [
+ AC_MSG_RESULT([Cannot find libpthread])
+ # Check for other thread systems here, set THREAD_LIBS to
+ # whatever is needed, and define
+ # AM_CONDITIONAL(THREADS_foo, true), and add it to the
+ # section in mono/metadata/Makefile.am
+ ])
+AC_SUBST(THREAD_LIBS)
CFLAGS='-g -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations'
diff --git a/mono/interpreter/ChangeLog b/mono/interpreter/ChangeLog
index 610fe8a2e24..894e0b9d798 100644
--- a/mono/interpreter/ChangeLog
+++ b/mono/interpreter/ChangeLog
@@ -1,5 +1,9 @@
2001-09-23 Dick Porter <dick@ximian.com>
+ * Makefile.am (mint_LDADD): rename PTHREAD_LIBS to THREAD_LIBS
+
+2001-09-23 Dick Porter <dick@ximian.com>
+
* interp.c (main): Do some thread setup and cleanup around the
call to ves_exec()
diff --git a/mono/interpreter/Makefile.am b/mono/interpreter/Makefile.am
index e173fb150ed..8d45d90251b 100644
--- a/mono/interpreter/Makefile.am
+++ b/mono/interpreter/Makefile.am
@@ -15,7 +15,7 @@ mint_LDADD = \
../metadata/libmetadata.a \
$(GLIB_LIBS) \
$(GMODULE_LIBS) \
- $(PTHREAD_LIBS) \
+ $(THREAD_LIBS) \
-lm
man_MANS = mint.1
diff --git a/mono/jit/ChangeLog b/mono/jit/ChangeLog
index 53907e71408..6a30cdcc4b3 100644
--- a/mono/jit/ChangeLog
+++ b/mono/jit/ChangeLog
@@ -1,3 +1,7 @@
+2001-09-23 Dick Porter <dick@ximian.com>
+
+ * Makefile.am (testjit_LDADD): rename PTHREAD_LIBS to THREAD_LIBS
+
2001-09-23 Dietmar Maurer <dietmar@ximian.com>
* testjit.c: use the memory pool to avoid memory leaks
diff --git a/mono/jit/Makefile.am b/mono/jit/Makefile.am
index d3bf6f19155..676dbafe4ee 100644
--- a/mono/jit/Makefile.am
+++ b/mono/jit/Makefile.am
@@ -20,7 +20,7 @@ testjit_LDADD = \
../metadata/libmetadata.a \
$(GLIB_LIBS) \
$(GMODULE_LIBS) \
- $(PTHREAD_LIBS) \
+ $(THREAD_LIBS) \
-lm
codegen-x86.c codegen.h: x86.brg
diff --git a/mono/metadata/ChangeLog b/mono/metadata/ChangeLog
index a12c26d5f35..c66c4b46ae2 100644
--- a/mono/metadata/ChangeLog
+++ b/mono/metadata/ChangeLog
@@ -1,5 +1,15 @@
2001-09-23 Dick Porter <dick@ximian.com>
+ * threads-dummy.c:
+ * threads-dummy.h: New files of dummy threading routines
+
+ * Makefile.am (THREAD_SOURCE): Arrange to compile different thread
+ support code based on system specifics
+
+ Rename PTHREAD_LIBS to THREAD_LIBS
+
+2001-09-23 Dick Porter <dick@ximian.com>
+
* threads-pthread.c: Implement the System.Threading.Thread::Sleep,
Schedule (called when asked to Sleep for 0 ms) and CurrentThread
internal calls.
diff --git a/mono/metadata/Makefile.am b/mono/metadata/Makefile.am
index 107c01bf342..ca94a8f27d8 100644
--- a/mono/metadata/Makefile.am
+++ b/mono/metadata/Makefile.am
@@ -11,6 +11,18 @@ INCLUDES = $(GLIB_CFLAGS) $(GMODULE_CFLAGS) -I$(top_srcdir) \
-DMONO_ASSEMBLIES=\""$(assembliesdir)"\"
+if THREADS_PTHREAD
+THREAD_SOURCE = \
+ threads-pthread.c \
+ threads-pthread.h \
+ #
+else
+THREAD_SOURCE = \
+ threads-dummy.h \
+ threads-dummy.c \
+ #
+endif
+
libmetadata_a_SOURCES = \
assembly.c \
image.c \
@@ -22,8 +34,7 @@ libmetadata_a_SOURCES = \
object.c \
icall.c \
threads.h \
- threads-pthread.c \
- threads-pthread.h \
+ $(THREAD_SOURCE) \
#
libmetadataincludedir = $(includedir)/mono/metadata
@@ -46,6 +57,6 @@ libmetadatainclude_HEADERS = \
pedump_SOURCES = \
pedump.c $(libmetadata_a_SOURCES)
-pedump_LDADD = $(GLIB_LIBS) $(GMODULE_LIBS) $(PTHREAD_LIBS)
+pedump_LDADD = $(GLIB_LIBS) $(GMODULE_LIBS) $(THREAD_LIBS)
diff --git a/mono/metadata/threads-dummy.c b/mono/metadata/threads-dummy.c
new file mode 100644
index 00000000000..af5bbe199b9
--- /dev/null
+++ b/mono/metadata/threads-dummy.c
@@ -0,0 +1,56 @@
+/*
+ * threads-dummy.c: System-specific thread support dummy routines
+ *
+ * Author:
+ * Dick Porter (dick@ximian.com)
+ *
+ * (C) 2001 Ximian, Inc.
+ */
+
+#include <config.h>
+#include <glib.h>
+
+#include <mono/metadata/object.h>
+#include <mono/metadata/threads.h>
+
+static MonoObject *main_thread;
+
+void ves_icall_System_Threading_Thread_Start_internal(MonoObject *this,
+ MonoObject *start)
+{
+}
+
+gint32 ves_icall_System_Threading_Thread_Sleep_internal(gint32 ms)
+{
+ return(0);
+}
+
+void ves_icall_System_Threading_Thread_Schedule_internal(void)
+{
+}
+
+MonoObject *ves_icall_System_Threading_Thread_CurrentThread_internal(void)
+{
+ return(main_thread);
+}
+
+void mono_thread_init(void)
+{
+ MonoClass *thread_class;
+
+ /* Build a System.Threading.Thread object instance to return
+ * for the main line's Thread.CurrentThread property.
+ */
+ thread_class=mono_class_from_name(mono_defaults.corlib, "System.Threading", "Thread");
+
+ /* I wonder what happens if someone tries to destroy this
+ * object? In theory, I guess the whole program should act as
+ * though exit() were called :-)
+ */
+ main_thread=mono_new_object(thread_class);
+}
+
+
+void mono_thread_cleanup(void)
+{
+}
diff --git a/mono/metadata/threads-dummy.h b/mono/metadata/threads-dummy.h
new file mode 100644
index 00000000000..0637ac2ad00
--- /dev/null
+++ b/mono/metadata/threads-dummy.h
@@ -0,0 +1,20 @@
+/*
+ * threads-dummy.h: System-specific thread support dummy routines
+ *
+ * Author:
+ * Dick Porter (dick@ximian.com)
+ *
+ * (C) 2001 Ximian, Inc.
+ */
+
+#ifndef _MONO_METADATA_THREADS_DUMMY_H_
+#define _MONO_METADATA_THREADS_DUMMY_H_
+
+#include <mono/metadata/object.h>
+
+extern void ves_icall_System_Threading_Thread_Start_internal(MonoObject *this, MonoObject *start);
+extern int ves_icall_System_Threading_Thread_Sleep_internal(int ms);
+extern void ves_icall_System_Threading_Thread_Schedule_internal(void);
+extern MonoObject *ves_icall_System_Threading_Thread_CurrentThread_internal(void);
+
+#endif /* _MONO_METADATA_THREADS_DUMMY_H_ */
diff --git a/mono/metadata/threads.h b/mono/metadata/threads.h
index beefc14222f..73e51d282e7 100644
--- a/mono/metadata/threads.h
+++ b/mono/metadata/threads.h
@@ -10,13 +10,16 @@
#ifndef _MONO_METADATA_THREADS_H_
#define _MONO_METADATA_THREADS_H_
+#include <config.h>
+
extern void mono_thread_init(void);
extern void mono_thread_cleanup(void);
#ifdef HAVE_PTHREAD_H
#include <mono/metadata/threads-pthread.h>
#else
-#error "No thread support found!"
+#warning "No thread support found!"
+#include <mono/metadata/threads-dummy.h>
#endif
#endif /* _MONO_METADATA_THREADS_H_ */