You've already forked linux-packaging-mono
Imported Upstream version 4.2.2.10
Former-commit-id: 925376e1db46149d14f7949fcd7b08805ea8aba9
This commit is contained in:
@@ -2339,6 +2339,8 @@ sgen_client_scan_thread_data (void *start_nursery, void *end_nursery, gboolean p
|
||||
|
||||
FOREACH_THREAD (info) {
|
||||
int skip_reason = 0;
|
||||
void *aligned_stack_start = (void*)(mword) ALIGN_TO ((mword)info->client_info.stack_start, SIZEOF_VOID_P);
|
||||
|
||||
if (info->client_info.skip) {
|
||||
SGEN_LOG (3, "Skipping dead thread %p, range: %p-%p, size: %zd", info, info->client_info.stack_start, info->client_info.stack_end, (char*)info->client_info.stack_end - (char*)info->client_info.stack_start);
|
||||
skip_reason = 1;
|
||||
@@ -2358,13 +2360,13 @@ sgen_client_scan_thread_data (void *start_nursery, void *end_nursery, gboolean p
|
||||
g_assert (info->client_info.suspend_done);
|
||||
SGEN_LOG (3, "Scanning thread %p, range: %p-%p, size: %zd, pinned=%zd", info, info->client_info.stack_start, info->client_info.stack_end, (char*)info->client_info.stack_end - (char*)info->client_info.stack_start, sgen_get_pinned_count ());
|
||||
if (mono_gc_get_gc_callbacks ()->thread_mark_func && !conservative_stack_mark) {
|
||||
mono_gc_get_gc_callbacks ()->thread_mark_func (info->client_info.runtime_data, info->client_info.stack_start, info->client_info.stack_end, precise, &ctx);
|
||||
mono_gc_get_gc_callbacks ()->thread_mark_func (info->client_info.runtime_data, aligned_stack_start, info->client_info.stack_end, precise, &ctx);
|
||||
} else if (!precise) {
|
||||
if (!conservative_stack_mark) {
|
||||
fprintf (stderr, "Precise stack mark not supported - disabling.\n");
|
||||
conservative_stack_mark = TRUE;
|
||||
}
|
||||
sgen_conservatively_pin_objects_from (info->client_info.stack_start, info->client_info.stack_end, start_nursery, end_nursery, PIN_TYPE_STACK);
|
||||
sgen_conservatively_pin_objects_from (aligned_stack_start, info->client_info.stack_end, start_nursery, end_nursery, PIN_TYPE_STACK);
|
||||
}
|
||||
|
||||
if (!precise) {
|
||||
|
||||
@@ -480,11 +480,13 @@ domain_get_next (ThreadPoolDomain *current)
|
||||
return tpdomain;
|
||||
}
|
||||
|
||||
static void
|
||||
/* return TRUE if timeout, FALSE otherwise (worker unpark or interrupt) */
|
||||
static gboolean
|
||||
worker_park (void)
|
||||
{
|
||||
mono_cond_t cond;
|
||||
MonoInternalThread *thread = mono_thread_internal_current ();
|
||||
gboolean timeout = FALSE;
|
||||
|
||||
mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] current worker parking", GetCurrentThreadId ());
|
||||
|
||||
@@ -495,10 +497,17 @@ worker_park (void)
|
||||
mono_mutex_lock (&threadpool->active_threads_lock);
|
||||
|
||||
if (!mono_runtime_is_shutting_down ()) {
|
||||
static gpointer rand_handle = NULL;
|
||||
|
||||
if (!rand_handle)
|
||||
rand_handle = rand_create ();
|
||||
g_assert (rand_handle);
|
||||
|
||||
g_ptr_array_add (threadpool->parked_threads, &cond);
|
||||
g_ptr_array_remove_fast (threadpool->working_threads, thread);
|
||||
|
||||
mono_cond_wait (&cond, &threadpool->active_threads_lock);
|
||||
if (mono_cond_timedwait_ms (&cond, &threadpool->active_threads_lock, rand_next (rand_handle, 5 * 1000, 60 * 1000)) != 0)
|
||||
timeout = TRUE;
|
||||
|
||||
g_ptr_array_add (threadpool->working_threads, thread);
|
||||
g_ptr_array_remove (threadpool->parked_threads, &cond);
|
||||
@@ -511,6 +520,8 @@ worker_park (void)
|
||||
mono_cond_destroy (&cond);
|
||||
|
||||
mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] current worker unparking", GetCurrentThreadId ());
|
||||
|
||||
return timeout;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -585,13 +596,15 @@ worker_thread (gpointer data)
|
||||
}
|
||||
|
||||
if (retire || !(tpdomain = domain_get_next (previous_tpdomain))) {
|
||||
gboolean timeout;
|
||||
|
||||
COUNTER_ATOMIC (counter, {
|
||||
counter._.working --;
|
||||
counter._.parked ++;
|
||||
});
|
||||
|
||||
mono_mutex_unlock (&threadpool->domains_lock);
|
||||
worker_park ();
|
||||
timeout = worker_park ();
|
||||
mono_mutex_lock (&threadpool->domains_lock);
|
||||
|
||||
COUNTER_ATOMIC (counter, {
|
||||
@@ -599,6 +612,9 @@ worker_thread (gpointer data)
|
||||
counter._.parked --;
|
||||
});
|
||||
|
||||
if (timeout)
|
||||
break;
|
||||
|
||||
if (retire)
|
||||
retire = FALSE;
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
4b6a091a05719bcaeae9c139036b3b64e47d3685
|
||||
6a8f7210854722081b142d053b3a793f67637e5e
|
||||
@@ -749,7 +749,7 @@ EXTRA_DIST = TestDriver.cs \
|
||||
Makefile.am.in
|
||||
|
||||
version.h: Makefile
|
||||
echo "#define FULL_VERSION \"Stable 4.2.1.124/39edf24\"" > version.h
|
||||
echo "#define FULL_VERSION \"Stable 4.2.2.10/7b87787\"" > version.h
|
||||
|
||||
# Utility target for patching libtool to speed up linking
|
||||
patch-libtool:
|
||||
|
||||
@@ -749,7 +749,7 @@ EXTRA_DIST = TestDriver.cs \
|
||||
Makefile.am.in
|
||||
|
||||
version.h: Makefile
|
||||
echo "#define FULL_VERSION \"Stable 4.2.1.124/39edf24\"" > version.h
|
||||
echo "#define FULL_VERSION \"Stable 4.2.2.10/7b87787\"" > version.h
|
||||
|
||||
# Utility target for patching libtool to speed up linking
|
||||
patch-libtool:
|
||||
|
||||
@@ -1 +1 @@
|
||||
3cfd458f71bd744fd88bb6d83cb1577e532349ed
|
||||
4b2d84dd6668bd0561add9df9659b3a3dbe4586b
|
||||
@@ -291,4 +291,112 @@ class Tests
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
enum LongEnum : ulong {
|
||||
A = 1
|
||||
}
|
||||
|
||||
public static int test_0_long_enum_eq_comparer () {
|
||||
var c = EqualityComparer<LongEnum>.Default;
|
||||
c.GetHashCode (LongEnum.A);
|
||||
return 0;
|
||||
}
|
||||
|
||||
enum UInt32Enum : uint {
|
||||
A = 1
|
||||
}
|
||||
|
||||
enum Int32Enum : int {
|
||||
A = 1
|
||||
}
|
||||
|
||||
enum Int16Enum : short {
|
||||
A = 1
|
||||
}
|
||||
|
||||
enum UInt16Enum : ushort {
|
||||
A = 1
|
||||
}
|
||||
|
||||
enum Int8Enum : sbyte {
|
||||
A = 1
|
||||
}
|
||||
|
||||
enum UInt8Enum : byte {
|
||||
A = 1
|
||||
}
|
||||
|
||||
public static int test_0_int_enum_eq_comparer () {
|
||||
var t1 = new Dictionary<Int32Enum, object> ();
|
||||
t1 [Int32Enum.A] = "foo";
|
||||
|
||||
var t2 = new Dictionary<UInt32Enum, object> ();
|
||||
t2 [UInt32Enum.A] = "foo";
|
||||
|
||||
var t3 = new Dictionary<UInt16Enum, object> ();
|
||||
t3 [UInt16Enum.A] = "foo";
|
||||
|
||||
var t4 = new Dictionary<Int16Enum, object> ();
|
||||
t4 [Int16Enum.A] = "foo";
|
||||
|
||||
var t5 = new Dictionary<Int8Enum, object> ();
|
||||
t5 [Int8Enum.A] = "foo";
|
||||
|
||||
var t6 = new Dictionary<UInt8Enum, object> ();
|
||||
t6 [UInt8Enum.A] = "foo";
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int test_0_array_accessor_runtime_invoke_ref () {
|
||||
var t = typeof (string[]);
|
||||
var arr = Array.CreateInstance (typeof (string), 1);
|
||||
arr.GetType ().GetMethod ("Set").Invoke (arr, new object [] { 0, "A" });
|
||||
var res = (string)arr.GetType ().GetMethod ("Get").Invoke (arr, new object [] { 0 });
|
||||
if (res != "A")
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static void SetArrayValue_<T> (T[] values) {
|
||||
values.Select (x => x).ToArray ();
|
||||
}
|
||||
|
||||
public static int test_0_delegate_invoke_wrappers_gsharedvt () {
|
||||
var enums = new LongEnum [] { LongEnum.A };
|
||||
SetArrayValue_ (enums);
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct LargeStruct {
|
||||
public int a, b, c, d;
|
||||
}
|
||||
|
||||
[MethodImplAttribute (MethodImplOptions.NoInlining)]
|
||||
public static bool GetHasValue<T>(T? value) where T : struct
|
||||
{
|
||||
return value.HasValue;
|
||||
}
|
||||
|
||||
[Category ("DYNCALL")]
|
||||
public static int test_0_large_nullable_invoke () {
|
||||
var s = new LargeStruct () { a = 1, b = 2, c = 3, d = 4 };
|
||||
|
||||
GetHasValue<LargeStruct> (s);
|
||||
|
||||
#if __MOBILE__
|
||||
var m = typeof(AotTests).GetMethod("GetHasValue", BindingFlags.Static | BindingFlags.Public);
|
||||
#else
|
||||
var m = typeof(Tests).GetMethod("GetHasValue", BindingFlags.Static | BindingFlags.Public);
|
||||
#endif
|
||||
|
||||
Type type = typeof (LargeStruct?).GetGenericArguments () [0];
|
||||
bool b1 = (bool)m.MakeGenericMethod (new Type[] {type}).Invoke (null, new object[] { s });
|
||||
if (!b1)
|
||||
return 1;
|
||||
bool b2 = (bool)m.MakeGenericMethod (new Type[] {type}).Invoke (null, new object[] { null });
|
||||
if (b2)
|
||||
return 2;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,6 +58,9 @@
|
||||
#include <locale.h>
|
||||
#include "version.h"
|
||||
#include "debugger-agent.h"
|
||||
#if TARGET_OSX
|
||||
# include <sys/resource.h>
|
||||
#endif
|
||||
|
||||
static FILE *mini_stats_fd;
|
||||
|
||||
@@ -1462,6 +1465,26 @@ switch_gc (char* argv[], const char* target_gc)
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef TARGET_OSX
|
||||
|
||||
/*
|
||||
* tries to increase the minimum number of files, if the number is below 1024
|
||||
*/
|
||||
static void
|
||||
darwin_change_default_file_handles ()
|
||||
{
|
||||
struct rlimit limit;
|
||||
|
||||
if (getrlimit (RLIMIT_NOFILE, &limit) == 0){
|
||||
if (limit.rlim_cur < 1024){
|
||||
limit.rlim_cur = MAX(1024,limit.rlim_cur);
|
||||
setrlimit (RLIMIT_NOFILE, &limit);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* mono_main:
|
||||
* @argc: number of arguments in the argv array
|
||||
@@ -1514,6 +1537,10 @@ mono_main (int argc, char* argv[])
|
||||
|
||||
setlocale (LC_ALL, "");
|
||||
|
||||
#if TARGET_OSX
|
||||
darwin_change_default_file_handles ();
|
||||
#endif
|
||||
|
||||
if (g_getenv ("MONO_NO_SMP"))
|
||||
mono_set_use_smp (FALSE);
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
b4605733bb4bb4fa16d13db526cb439680307bba
|
||||
4ebbe548d71b7a3556b34b718274beb4d108c38a
|
||||
@@ -1 +1 @@
|
||||
#define FULL_VERSION "Stable 4.2.1.124/39edf24"
|
||||
#define FULL_VERSION "Stable 4.2.2.10/7b87787"
|
||||
|
||||
@@ -19,7 +19,7 @@ if HAVE_VTUNE
|
||||
vtune_lib = libmono-profiler-vtune.la
|
||||
endif
|
||||
|
||||
lib_LTLIBRARIES = libmono-profiler-aot.la libmono-profiler-iomap.la libmono-profiler-log.la $(vtune_lib)
|
||||
lib_LTLIBRARIES = libmono-profiler-aot.la libmono-profiler-iomap.la libmono-profiler-log.la libmono-profiler-log-static.la $(vtune_lib)
|
||||
|
||||
if PLATFORM_DARWIN
|
||||
libmono_profiler_log_la_LDFLAGS = -Wl,-undefined -Wl,suppress -Wl,-flat_namespace
|
||||
@@ -68,6 +68,14 @@ libmono_profiler_vtune_la_CFLAGS = $(VTUNE_CFLAGS)
|
||||
libmono_profiler_vtune_la_LIBADD = $(VTUNE_LIBS) $(LIBMONO) $(GLIB_LIBS) $(LIBICONV)
|
||||
endif
|
||||
|
||||
# The log profile uses eglib functions, so it needs to be linked against
|
||||
# libeglib in shared mode, but not in static mode, since that would
|
||||
# leads to duplicate symbols when it is linked into an app which
|
||||
# also uses eglib (e.g. the runtime). Automake doesn't support this
|
||||
# functionality, so create a separate static version of the library.
|
||||
libmono_profiler_log_static_la_SOURCES = proflog.c
|
||||
libmono_profiler_log_static_la_LDFLAGS = -static
|
||||
|
||||
mprof_report_SOURCES = decode.c
|
||||
mprof_report_LDADD = $(Z_LIBS) $(GLIB_LIBS) $(LIBICONV)
|
||||
|
||||
|
||||
@@ -160,6 +160,16 @@ libmono_profiler_iomap_la_OBJECTS = \
|
||||
$(am_libmono_profiler_iomap_la_OBJECTS)
|
||||
@DISABLE_LIBRARIES_FALSE@@DISABLE_PROFILER_FALSE@@HOST_WIN32_FALSE@am_libmono_profiler_iomap_la_rpath = -rpath \
|
||||
@DISABLE_LIBRARIES_FALSE@@DISABLE_PROFILER_FALSE@@HOST_WIN32_FALSE@ $(libdir)
|
||||
libmono_profiler_log_static_la_LIBADD =
|
||||
am_libmono_profiler_log_static_la_OBJECTS = proflog.lo
|
||||
libmono_profiler_log_static_la_OBJECTS = \
|
||||
$(am_libmono_profiler_log_static_la_OBJECTS)
|
||||
libmono_profiler_log_static_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
|
||||
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
|
||||
$(AM_CFLAGS) $(CFLAGS) \
|
||||
$(libmono_profiler_log_static_la_LDFLAGS) $(LDFLAGS) -o $@
|
||||
@DISABLE_LIBRARIES_FALSE@@DISABLE_PROFILER_FALSE@@HOST_WIN32_FALSE@am_libmono_profiler_log_static_la_rpath = -rpath \
|
||||
@DISABLE_LIBRARIES_FALSE@@DISABLE_PROFILER_FALSE@@HOST_WIN32_FALSE@ $(libdir)
|
||||
libmono_profiler_log_la_DEPENDENCIES = $(am__DEPENDENCIES_3) \
|
||||
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
|
||||
am_libmono_profiler_log_la_OBJECTS = proflog.lo
|
||||
@@ -221,10 +231,12 @@ am__v_CCLD_0 = @echo " CCLD " $@;
|
||||
am__v_CCLD_1 =
|
||||
SOURCES = $(libmono_profiler_aot_la_SOURCES) \
|
||||
$(libmono_profiler_iomap_la_SOURCES) \
|
||||
$(libmono_profiler_log_static_la_SOURCES) \
|
||||
$(libmono_profiler_log_la_SOURCES) \
|
||||
$(libmono_profiler_vtune_la_SOURCES) $(mprof_report_SOURCES)
|
||||
DIST_SOURCES = $(libmono_profiler_aot_la_SOURCES) \
|
||||
$(libmono_profiler_iomap_la_SOURCES) \
|
||||
$(libmono_profiler_log_static_la_SOURCES) \
|
||||
$(libmono_profiler_log_la_SOURCES) \
|
||||
$(am__libmono_profiler_vtune_la_SOURCES_DIST) \
|
||||
$(mprof_report_SOURCES)
|
||||
@@ -471,7 +483,7 @@ AM_CPPFLAGS = \
|
||||
$(GLIB_CFLAGS)
|
||||
|
||||
@DISABLE_LIBRARIES_FALSE@@DISABLE_PROFILER_FALSE@@HAVE_VTUNE_TRUE@@HOST_WIN32_FALSE@vtune_lib = libmono-profiler-vtune.la
|
||||
@DISABLE_LIBRARIES_FALSE@@DISABLE_PROFILER_FALSE@@HOST_WIN32_FALSE@lib_LTLIBRARIES = libmono-profiler-aot.la libmono-profiler-iomap.la libmono-profiler-log.la $(vtune_lib)
|
||||
@DISABLE_LIBRARIES_FALSE@@DISABLE_PROFILER_FALSE@@HOST_WIN32_FALSE@lib_LTLIBRARIES = libmono-profiler-aot.la libmono-profiler-iomap.la libmono-profiler-log.la libmono-profiler-log-static.la $(vtune_lib)
|
||||
@DISABLE_LIBRARIES_FALSE@@DISABLE_PROFILER_FALSE@@HOST_WIN32_FALSE@@PLATFORM_ANDROID_TRUE@libmono_profiler_log_la_LDFLAGS = -avoid-version
|
||||
@DISABLE_LIBRARIES_FALSE@@DISABLE_PROFILER_FALSE@@HOST_WIN32_FALSE@@PLATFORM_DARWIN_TRUE@libmono_profiler_log_la_LDFLAGS = -Wl,-undefined -Wl,suppress -Wl,-flat_namespace
|
||||
@DISABLE_EXECUTABLES_FALSE@@SHARED_MONO_FALSE@@SUPPORT_BOEHM_TRUE@LIBMONO = $(top_builddir)/mono/mini/$(LIBMONO_LA) $(static_libs)
|
||||
@@ -496,6 +508,14 @@ libmono_profiler_log_la_LIBADD = $(LIBMONO) $(GLIB_LIBS) $(Z_LIBS)
|
||||
@HAVE_VTUNE_TRUE@libmono_profiler_vtune_la_SOURCES = mono-profiler-vtune.c
|
||||
@HAVE_VTUNE_TRUE@libmono_profiler_vtune_la_CFLAGS = $(VTUNE_CFLAGS)
|
||||
@HAVE_VTUNE_TRUE@libmono_profiler_vtune_la_LIBADD = $(VTUNE_LIBS) $(LIBMONO) $(GLIB_LIBS) $(LIBICONV)
|
||||
|
||||
# The log profile uses eglib functions, so it needs to be linked against
|
||||
# libeglib in shared mode, but not in static mode, since that would
|
||||
# leads to duplicate symbols when it is linked into an app which
|
||||
# also uses eglib (e.g. the runtime). Automake doesn't support this
|
||||
# functionality, so create a separate static version of the library.
|
||||
libmono_profiler_log_static_la_SOURCES = proflog.c
|
||||
libmono_profiler_log_static_la_LDFLAGS = -static
|
||||
mprof_report_SOURCES = decode.c
|
||||
mprof_report_LDADD = $(Z_LIBS) $(GLIB_LIBS) $(LIBICONV)
|
||||
PLOG_TESTS_SRC = test-alloc.cs test-busy.cs test-monitor.cs test-excleave.cs \
|
||||
@@ -587,6 +607,9 @@ libmono-profiler-aot.la: $(libmono_profiler_aot_la_OBJECTS) $(libmono_profiler_a
|
||||
libmono-profiler-iomap.la: $(libmono_profiler_iomap_la_OBJECTS) $(libmono_profiler_iomap_la_DEPENDENCIES) $(EXTRA_libmono_profiler_iomap_la_DEPENDENCIES)
|
||||
$(AM_V_CCLD)$(LINK) $(am_libmono_profiler_iomap_la_rpath) $(libmono_profiler_iomap_la_OBJECTS) $(libmono_profiler_iomap_la_LIBADD) $(LIBS)
|
||||
|
||||
libmono-profiler-log-static.la: $(libmono_profiler_log_static_la_OBJECTS) $(libmono_profiler_log_static_la_DEPENDENCIES) $(EXTRA_libmono_profiler_log_static_la_DEPENDENCIES)
|
||||
$(AM_V_CCLD)$(libmono_profiler_log_static_la_LINK) $(am_libmono_profiler_log_static_la_rpath) $(libmono_profiler_log_static_la_OBJECTS) $(libmono_profiler_log_static_la_LIBADD) $(LIBS)
|
||||
|
||||
libmono-profiler-log.la: $(libmono_profiler_log_la_OBJECTS) $(libmono_profiler_log_la_DEPENDENCIES) $(EXTRA_libmono_profiler_log_la_DEPENDENCIES)
|
||||
$(AM_V_CCLD)$(libmono_profiler_log_la_LINK) $(am_libmono_profiler_log_la_rpath) $(libmono_profiler_log_la_OBJECTS) $(libmono_profiler_log_la_LIBADD) $(LIBS)
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
f72a4476c3a46011d9e92c33d1ed3a6034ee3647
|
||||
d019b1cf2962cfa266f0b7e6f75396789273ef1c
|
||||
@@ -247,7 +247,7 @@ sgen_card_table_mark_range (mword address, mword size)
|
||||
SGEN_ASSERT (0, num_cards <= CARD_COUNT_IN_BYTES, "How did we get an object larger than the card table?");
|
||||
if (end > SGEN_CARDTABLE_END) {
|
||||
memset (start, 1, SGEN_CARDTABLE_END - start);
|
||||
memset (sgen_cardtable, 1, end - sgen_cardtable);
|
||||
memset (sgen_cardtable, 1, end - SGEN_CARDTABLE_END);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1 +1 @@
|
||||
21fd9dab9e70d3456026645e195f183d4ffb2739
|
||||
2fc21552caddc04ff91dd8a266149ea98d4f0dc0
|
||||
@@ -182,6 +182,7 @@ BASE_TEST_CS_SRC= \
|
||||
delegate10.cs \
|
||||
delegate11.cs \
|
||||
delegate12.cs \
|
||||
delegate13.cs \
|
||||
remoting1.cs \
|
||||
remoting2.cs \
|
||||
remoting3.cs \
|
||||
|
||||
@@ -601,6 +601,7 @@ BASE_TEST_CS_SRC = \
|
||||
delegate10.cs \
|
||||
delegate11.cs \
|
||||
delegate12.cs \
|
||||
delegate13.cs \
|
||||
remoting1.cs \
|
||||
remoting2.cs \
|
||||
remoting3.cs \
|
||||
|
||||
31
mono/tests/delegate13.cs
Normal file
31
mono/tests/delegate13.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
|
||||
public static class Program
|
||||
{
|
||||
public static int Main ()
|
||||
{
|
||||
Action d1 = new Action (Method1);
|
||||
Action d2 = new Action (Method2);
|
||||
Action d12 = d1 + d2;
|
||||
Action d21 = d2 + d1;
|
||||
|
||||
if (d1.Method.Name != "Method1")
|
||||
return 1;
|
||||
if (d2.Method.Name != "Method2")
|
||||
return 2;
|
||||
if (d12.Method.Name != "Method2")
|
||||
return 3;
|
||||
if (d21.Method.Name != "Method1")
|
||||
return 4;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static void Method1 ()
|
||||
{
|
||||
}
|
||||
|
||||
public static void Method2 ()
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user