Compare commits

..
Author SHA1 Message Date
Alexis Christoforides 14f2c814cc Trigger a CI build to attempt to include Nuget 2 once again, at least see if it would build (there were issues around the time we stopped building it) 2017-08-24 09:54:20 -04:00
Luis Aguilera 1e2ec7d8db Merge pull request #5421 from marek-safar/d15-3-fixes
[System.Net.Http]: Close request stream when HttpClientHandler.SendAs…
2017-08-23 11:28:35 -04:00
Luis Aguilera adb727509c Merge pull request #5432 from marek-safar/d15-3-fixes2
[threadpool] Reduce logging verbosity level. Fixes #58829
2017-08-23 11:01:43 -04:00
Martin Baulig 5313a669a7 [System.Net.Http]: Close request stream when HttpClientHandler.SendAsync() is done writing data. (#5226) (#5231)
(cherry picked from commit d1555c7c72)
2017-08-23 14:59:40 +02:00
Marek Safar c75bcfe270 [threadpool] Reduce logging verbosity level. Fixes #58829 2017-08-23 10:24:46 +02:00
Luis Aguilera 2a6502cee0 Merge pull request #5401 from marek-safar/com
[Marshal.IsComObject] Make this predicate return false instead of thr…
2017-08-18 10:04:06 -04:00
Luis Aguilera 02457c20fc Merge pull request #5400 from spouliot/bump-cecil-58834-d15-3
[cecil] Bump to the head of the mono-2017-04 branch and pick the fix for bug #58834
2017-08-18 09:59:06 -04:00
Miguel de Icaza 5e05cafc6f [Marshal.IsComObject] Make this predicate return false instead of throwing an exception which is what the calling code expects (#5246) 2017-08-18 15:26:49 +02:00
Sebastien Pouliot 73fd9a1b82 [cecil] Bump to the head of the mono-2017-04 branch and pick the fix for bug #58834
This will fix xamarin-macios builds wrt bug #58834

https://bugzilla.xamarin.com/show_bug.cgi?id=58834
2017-08-17 22:09:44 -04:00
Luis Aguilera da80840ea5 Merge pull request #5247 from radical/pick-msbuild-fix-trigger-wrench
Empty commit to trigger wrench build, to pick up a msbuild "fix"
2017-07-20 14:10:59 -04:00
Ankit Jain 447a74e440 Empty commit to trigger wrench build, to pick up a msbuild "fix"
This is to get a msbuild workaround:

	https://github.com/mono/msbuild/pull/19

The fix for the issue is not critical enough to get into 15.3 at this
time. A user would get an unclear error, instead we emit a warning to
inform her how to avoid the issue.

The real fix will be included in 15.4 .

Bug: https://bugzilla.xamarin.com/show_bug.cgi?id=58228
2017-07-20 14:02:52 -04:00
Luis Aguilera ef39d08daf Merge pull request #5222 from radical/trigger-wrench
reverting msbuild changes to get ready to ship 15.3
2017-07-17 16:36:16 -04:00
Ankit Jain df66c66353 Empty commit to trigger wrench build. 2017-07-17 16:30:40 -04:00
Luis Aguilera b3d1b69247 Merge pull request #5193 from luhenry/2017-04-fix-56155
[runtime] Rework process waiting.
2017-07-12 14:47:37 -04:00
Zoltan Varga 3b924c60cc [runtime] Rework process waiting.
Instead of using fragile lockless code in the sigchld signal handler, wake up the finalizer thread and make it call back
into the process code to signal finished processes.
2017-07-10 14:56:09 -04:00
Zoltan Varga 3d531ba625 [jit] Use the right type when handling shared versions of RuntimeHelpers.IsReferenceOrContainsReferences (). The previous version only worked by accident. (#5160) 2017-07-03 11:52:40 -04:00
13 changed files with 111 additions and 104 deletions

No files matched your search

+1 -1
View File
@@ -1949,7 +1949,7 @@ if test x$host_win32 = xno; then
AC_CHECK_HEADERS(pthread.h)
AC_CHECK_HEADERS(pthread_np.h)
AC_CHECK_FUNCS(pthread_mutex_timedlock)
AC_CHECK_FUNCS(pthread_getattr_np pthread_attr_get_np pthread_setname_np pthread_cond_timedwait_relative_np)
AC_CHECK_FUNCS(pthread_getattr_np pthread_attr_get_np pthread_setname_np)
AC_CHECK_FUNCS(pthread_kill)
AC_MSG_CHECKING(for PTHREAD_MUTEX_RECURSIVE)
AC_TRY_COMPILE([ #include <pthread.h>], [
+1 -1
@@ -375,8 +375,9 @@ namespace System.Net.Http
wrequest.ResendContentFactory = content.CopyTo;
var stream = await wrequest.GetRequestStreamAsync ().ConfigureAwait (false);
await request.Content.CopyToAsync (stream).ConfigureAwait (false);
using (var stream = await wrequest.GetRequestStreamAsync ().ConfigureAwait (false)) {
await request.Content.CopyToAsync (stream).ConfigureAwait (false);
}
} else if (HttpMethod.Post.Equals (request.Method) || HttpMethod.Put.Equals (request.Method) || HttpMethod.Delete.Equals (request.Method)) {
// Explicitly set this to make sure we're sending a "Content-Length: 0" header.
// This fixes the issue that's been reported on the forums:
@@ -482,8 +482,7 @@ namespace System.Diagnostics
if (proc == IntPtr.Zero)
throw new ArgumentException ("Can't find process with ID " + processId.ToString ());
/* The handle returned by GetProcess_internal is owned by its called, so we must pass true to SafeProcessHandle */
return (new Process (new SafeProcessHandle (proc, true), processId));
return (new Process (new SafeProcessHandle (proc, false), processId));
}
public static Process[] GetProcessesByName(string processName, string machineName)
@@ -741,7 +741,7 @@ namespace System.Runtime.InteropServices
#else
public static bool IsComObject (object o)
{
throw new PlatformNotSupportedException ();
return false;
}
#endif
+4 -4
View File
@@ -387,7 +387,7 @@ worker_park (void)
gboolean timeout = FALSE;
gboolean interrupted = FALSE;
mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_THREADPOOL, "[%p] worker parking", mono_native_thread_id_get ());
mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] worker parking", mono_native_thread_id_get ());
mono_coop_mutex_lock (&worker.parked_threads_lock);
@@ -430,7 +430,7 @@ done:
mono_coop_mutex_unlock (&worker.parked_threads_lock);
mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_THREADPOOL, "[%p] worker unparking, timeout? %s interrupted? %s",
mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] worker unparking, timeout? %s interrupted? %s",
mono_native_thread_id_get (), timeout ? "yes" : "no", interrupted ? "yes" : "no");
return timeout;
@@ -461,7 +461,7 @@ worker_thread (gpointer unused)
MonoInternalThread *thread;
ThreadPoolWorkerCounter counter;
mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_THREADPOOL, "[%p] worker starting", mono_native_thread_id_get ());
mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] worker starting", mono_native_thread_id_get ());
if (!mono_refcount_tryinc (&worker))
return 0;
@@ -498,7 +498,7 @@ worker_thread (gpointer unused)
counter._.working --;
});
mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_THREADPOOL, "[%p] worker finishing", mono_native_thread_id_get ());
mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] worker finishing", mono_native_thread_id_get ());
mono_refcount_dec (&worker);
+21
View File
@@ -1314,6 +1314,13 @@ class Tests
return RuntimeHelpers.IsReferenceOrContainsReferences<T> ();
}
class IsRefClass<T> {
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public bool is_ref () {
return RuntimeHelpers.IsReferenceOrContainsReferences<T> ();
}
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static bool is_ref_or_contains_refs_gen_ref<T> () {
return RuntimeHelpers.IsReferenceOrContainsReferences<GenStruct<T>> ();
@@ -1343,6 +1350,12 @@ class Tests
int i;
}
struct AStruct3<T1, T2, T3> {
T1 t1;
T2 t2;
T3 t3;
}
public static int test_0_isreference_intrins () {
if (RuntimeHelpers.IsReferenceOrContainsReferences<int> ())
return 1;
@@ -1368,6 +1381,14 @@ class Tests
if (is_ref_or_contains_refs_gen_noref<string> ())
return 10;
// Complex type from shared class method
var c1 = new IsRefClass<AStruct3<int, int, int>> ();
if (c1.is_ref ())
return 11;
var c2 = new IsRefClass<AStruct3<string, int, int>> ();
if (!c2.is_ref ())
return 12;
return 0;
}
}
+24
View File
@@ -1972,6 +1972,30 @@ public class Tests
gsharedvt_vphi (0);
return 0;
}
struct AStruct3<T1, T2, T3> {
T1 t1;
T2 t2;
T3 t3;
}
interface IFaceIsRef {
bool is_ref<T> ();
}
class ClassIsRef : IFaceIsRef {
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public bool is_ref<T> () {
return RuntimeHelpers.IsReferenceOrContainsReferences<T> ();
}
}
public static int test_0_isreference_intrins () {
IFaceIsRef iface = new ClassIsRef ();
Console.WriteLine ("X: " + iface.is_ref<AStruct3<int, int, int>> ());
Console.WriteLine ("X: " + iface.is_ref<AStruct3<string, int, int>> ());
return 0;
}
}
// #13191
+10 -4
View File
@@ -5407,11 +5407,15 @@ mini_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign
g_assert (ctx);
g_assert (ctx->method_inst);
g_assert (ctx->method_inst->type_argc == 1);
MonoType *t = mini_get_underlying_type (ctx->method_inst->type_argv [0]);
MonoClass *klass = mono_class_from_mono_type (t);
MonoType *arg_type = ctx->method_inst->type_argv [0];
MonoType *t;
MonoClass *klass;
ins = NULL;
/* Resolve the argument class as possible so we can handle common cases fast */
t = mini_get_underlying_type (arg_type);
klass = mono_class_from_mono_type (t);
mono_class_init (klass);
if (MONO_TYPE_IS_REFERENCE (t))
EMIT_NEW_ICONST (cfg, ins, 1);
@@ -5424,10 +5428,12 @@ mini_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign
else {
g_assert (cfg->gshared);
int context_used = mini_class_check_context_used (cfg, klass);
/* Have to use the original argument class here */
MonoClass *arg_class = mono_class_from_mono_type (arg_type);
int context_used = mini_class_check_context_used (cfg, arg_class);
/* This returns 1 or 2 */
MonoInst *info = mini_emit_get_rgctx_klass (cfg, context_used, klass, MONO_RGCTX_INFO_CLASS_IS_REF_OR_CONTAINS_REFS);
MonoInst *info = mini_emit_get_rgctx_klass (cfg, context_used, arg_class, MONO_RGCTX_INFO_CLASS_IS_REF_OR_CONTAINS_REFS);
int dreg = alloc_ireg (cfg);
EMIT_NEW_BIALU_IMM (cfg, ins, OP_ISUB_IMM, dreg, info->dreg, 1);
}
-1
View File
@@ -59,7 +59,6 @@ monoutils_sources = \
mono-mmap-internals.h \
mono-mmap-windows-internals.h \
mono-os-mutex.h \
mono-os-mutex.c \
mono-coop-mutex.h \
mono-once.h \
mono-lazy-init.h \
-84
View File
@@ -1,84 +0,0 @@
/**
* \file
* Portability wrappers around POSIX Mutexes
*
* Authors: Jeffrey Stedfast <[email protected]>
*
* Copyright 2002 Ximian, Inc. (www.ximian.com)
*
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*
*/
#include <config.h>
#if !defined(HOST_WIN32)
#if defined(TARGET_OSX)
/* So we can use the declaration of pthread_cond_timedwait_relative_np () */
#undef _XOPEN_SOURCE
#endif
#include <pthread.h>
#include "mono-os-mutex.h"
int
mono_os_cond_timedwait (mono_cond_t *cond, mono_mutex_t *mutex, guint32 timeout_ms)
{
struct timespec ts;
int res;
if (timeout_ms == MONO_INFINITE_WAIT) {
mono_os_cond_wait (cond, mutex);
return 0;
}
/* ms = 10^-3, us = 10^-6, ns = 10^-9 */
/* This function only seems to be available on 64bit osx */
#if defined(HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE_NP) && defined(TARGET_OSX)
memset (&ts, 0, sizeof (struct timespec));
ts.tv_sec = timeout_ms / 1000;
ts.tv_nsec = (timeout_ms % 1000) * 1000 * 1000;
res = pthread_cond_timedwait_relative_np (cond, mutex, &ts);
if (G_UNLIKELY (res != 0 && res != ETIMEDOUT)) {
g_print ("cond: %p mutex: %p\n", *(gpointer*)cond, *(gpointer*)mutex);
g_error ("%s: pthread_cond_timedwait_relative_np failed with \"%s\" (%d) %ld %ld %d", __func__, g_strerror (res), res, ts.tv_sec, ts.tv_nsec, timeout_ms);
}
return res != 0 ? -1 : 0;
#else
#ifdef BROKEN_CLOCK_SOURCE
struct timeval tv;
/* clock_gettime is not supported in MAC OS x */
res = gettimeofday (&tv, NULL);
if (G_UNLIKELY (res != 0))
g_error ("%s: gettimeofday failed with \"%s\" (%d)", __func__, g_strerror (errno), errno);
ts.tv_sec = tv.tv_sec;
ts.tv_nsec = tv.tv_usec * 1000;
#else
/* cond is using CLOCK_MONOTONIC as time source */
res = clock_gettime (CLOCK_MONOTONIC, &ts);
if (G_UNLIKELY (res != 0))
g_error ("%s: clock_gettime failed with \"%s\" (%d)", __func__, g_strerror (errno), errno);
#endif
ts.tv_sec += timeout_ms / 1000;
ts.tv_nsec += (timeout_ms % 1000) * 1000 * 1000;
if (ts.tv_nsec >= 1000 * 1000 * 1000) {
ts.tv_nsec -= 1000 * 1000 * 1000;
ts.tv_sec ++;
}
res = pthread_cond_timedwait (cond, mutex, &ts);
if (G_UNLIKELY (res != 0 && res != ETIMEDOUT)) {
g_print ("cond: %p mutex: %p\n", *(gpointer*)cond, *(gpointer*)mutex);
g_error ("%s: pthread_cond_timedwait failed with \"%s\" (%d) %ld %ld %d", __func__, g_strerror (res), res, ts.tv_sec, ts.tv_nsec, timeout_ms);
}
return res != 0 ? -1 : 0;
#endif /* !HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE_NP */
}
#endif /* HOST_WIN32 */
+44 -2
View File
@@ -175,8 +175,50 @@ mono_os_cond_wait (mono_cond_t *cond, mono_mutex_t *mutex)
g_error ("%s: pthread_cond_wait failed with \"%s\" (%d)", __func__, g_strerror (res), res);
}
int
mono_os_cond_timedwait (mono_cond_t *cond, mono_mutex_t *mutex, guint32 timeout_ms);
static inline int
mono_os_cond_timedwait (mono_cond_t *cond, mono_mutex_t *mutex, guint32 timeout_ms)
{
#ifdef BROKEN_CLOCK_SOURCE
struct timeval tv;
#endif
struct timespec ts;
int res;
if (timeout_ms == MONO_INFINITE_WAIT) {
mono_os_cond_wait (cond, mutex);
return 0;
}
/* ms = 10^-3, us = 10^-6, ns = 10^-9 */
#ifdef BROKEN_CLOCK_SOURCE
/* clock_gettime is not supported in MAC OS x */
res = gettimeofday (&tv, NULL);
if (G_UNLIKELY (res != 0))
g_error ("%s: gettimeofday failed with \"%s\" (%d)", __func__, g_strerror (errno), errno);
ts.tv_sec = tv.tv_sec;
ts.tv_nsec = tv.tv_usec * 1000;
#else
/* cond is using CLOCK_MONOTONIC as time source */
res = clock_gettime (CLOCK_MONOTONIC, &ts);
if (G_UNLIKELY (res != 0))
g_error ("%s: clock_gettime failed with \"%s\" (%d)", __func__, g_strerror (errno), errno);
#endif
ts.tv_sec += timeout_ms / 1000;
ts.tv_nsec += (timeout_ms % 1000) * 1000 * 1000;
if (ts.tv_nsec >= 1000 * 1000 * 1000) {
ts.tv_nsec -= 1000 * 1000 * 1000;
ts.tv_sec ++;
}
res = pthread_cond_timedwait (cond, mutex, &ts);
if (G_UNLIKELY (res != 0 && res != ETIMEDOUT))
g_error ("%s: pthread_cond_timedwait failed with \"%s\" (%d) %ld %ld %d", __func__, g_strerror (res), res, ts.tv_sec, ts.tv_nsec, timeout_ms);
return res != 0 ? -1 : 0;
}
static inline void
mono_os_cond_signal (mono_cond_t *cond)
+1 -2
View File
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
@@ -109,7 +109,6 @@
<ClCompile Include="..\mono\utils\mono-uri.c" />
<ClCompile Include="..\mono\utils\mono-value-hash.c" />
<ClCompile Include="..\mono\utils\monobitset.c" />
<ClCompile Include="..\mono\utils\mono-os-mutex.c" />
<ClCompile Include="..\mono\utils\os-event-win32.c" />
<ClCompile Include="..\mono\utils\strenc.c" />
<ClCompile Include="..\mono\utils\atomic.c" />