* [netcore] Complete Monitor.LockContentionCount implementation
Fixes https://github.com/mono/mono/pull/16538
Commit migrated from https://github.com/mono/mono/commit/
722c6f7dd59d235c2403c110869b74d8e63ac07d
# This line is parsed by tools besides autoconf, such as msvc/mono.winconfig.targets.
# It should remain in the format they expect.
#
-MONO_CORLIB_VERSION=4e2d4257-1f2b-418c-9829-dd006fe09df5
+MONO_CORLIB_VERSION=3EAB4D03-8026-4D77-B1AE-AC96DF737E67
#
# Put a quoted #define in config.h.
mono_coop_mutex_unlock (mon->entry_mutex);
}
+#ifdef ENABLE_NETCORE
+static gint64 thread_contentions; /* for Monitor.LockContentionCount, otherwise mono_perfcounters struct is used */
+#endif
+
/* If allow_interruption==TRUE, the method will be interrupted if abort or suspend
* is requested. In this case it returns -1.
*/
/* The object must be locked by someone else... */
#ifndef DISABLE_PERFCOUNTERS
mono_atomic_inc_i32 (&mono_perfcounters->thread_contentions);
+#else
+#ifdef ENABLE_NETCORE
+ mono_atomic_inc_i64 (&thread_contentions);
+#endif
#endif
/* If ms is 0 we don't block, but just fail straight away */
#ifndef DISABLE_PERFCOUNTERS
return mono_perfcounters->thread_contentions;
#else
- return 0;
+ return thread_contentions;
#endif
}
-#endif
\ No newline at end of file
+#endif
## System.Threading.Tests
####################################################################
-# Monitor.LockContentionCount is not implemented
-# Implementation https://github.com/mono/mono/issues/15155
-# https://github.com/mono/mono/issues/15156
--nomethod System.Threading.Tests.MonitorTests.Enter_HasToWait_LockContentionCountTest
-
# Process hangs and test fails with [ERROR] FATAL UNHANDLED EXCEPTION: System.Threading.WaitHandleCannotBeOpenedException: No handle of the given name exists.
# https://github.com/mono/mono/issues/15157
-nomethod System.Threading.Tests.MutexTests.CrossProcess_NamedMutex_ProtectedFileAccessAtomic