xamarin-macios/runtime
Rolf Bjarne Kvinge 610dcc8a03 [runtime] Don't hold the framework lock when running managed code. Fixes #59994. (#2848)
There is a deadlock between the framework lock and the GC lock; resolve this
by making sure we don't execute managed code while holding the framework lock.

The framework lock was introduced in
xamarin/maccore@4a0748b1d8, and from analyzing
that commit message, it seems we're safe as long as nobody retains/releases
NSObjects (in way that makes the retainCount jump to or from 1) while the GC
runs.

Calling `xamarin_unregister_nsobject` does not affect the retain count of the
object; thus it's not necessary to keep the lock during the call to
`xamarin_unregister_nsobject`.

https://bugzilla.xamarin.com/show_bug.cgi?id=59994
4a0748b1d8
2017-10-09 10:59:25 +02:00
..
xamarin Add support for NSDirectionalEdgeInsets NSValues to the BindAs attribute. 2017-09-25 16:06:50 +02:00
.gitignore [mtouch/runtime] Implement support for tvOS extensions. 2016-04-25 18:15:02 -04:00
COOP.md Initial review pass for COOP for watchOS. 2016-05-26 17:47:10 +02:00
Delegates.cs.t4 [ObjCRuntime] Store a pointer to the initialization options in managed memory. (#1076) 2016-11-01 12:40:51 +01:00
EXCEPTIONS.md [runtime] Improve documentation about exceptions a little bit. 2016-06-08 20:11:07 +02:00
Makefile Merge branch 'xcode9' into xcode9-master-merge 2017-09-15 11:05:30 -04:00
README.md Initial review pass for COOP for watchOS. 2016-05-26 17:47:10 +02:00
Xamarin.framework-ios.Info.plist Create a Xamarin[-debug].framework. 2017-02-10 14:29:09 +01:00
Xamarin.framework-tvos.Info.plist Create a Xamarin[-debug].framework. 2017-02-10 14:29:09 +01:00
Xamarin.framework-watchos.Info.plist Create a Xamarin[-debug].framework. 2017-02-10 14:29:09 +01:00
bindings-generator.cs [SIMD] Implement Simd double types (VectorDouble3/MatrixDouble4x4). (#2632) 2017-09-13 15:28:16 -04:00
bindings-generator.csproj Add missing [MarshalDirective] attributes. (#2558) 2017-08-29 14:59:24 +02:00
bindings.h [SIMD] Implement Simd double types (VectorDouble3/MatrixDouble4x4). (#2632) 2017-09-13 15:28:16 -04:00
bindings.m [Vision] Add bindings for Xcode 9 Beta 1, 2 & 3 (#2301) 2017-07-18 11:12:10 -05:00
delegates.h.t4 Build our runtime. 2016-04-24 14:47:24 -04:00
delegates.inc.t4 Build our runtime. 2016-04-24 14:47:24 -04:00
delegates.t4 Merge remote-tracking branch 'origin/master' into bindas-registrar-support 2017-09-22 10:50:07 +02:00
exports.t4 [runtime] Call mono_raise_exception if mono_set_pending_exception isn't available. Works around bug #59979 (#2845) 2017-10-05 18:13:44 +02:00
extension-main.m [mtouch/runtime] Implement support for tvOS extensions. 2016-04-25 18:15:02 -04:00
frameworks.h [registrar] Add support for the BindAs attribute. 2017-07-04 07:35:29 +02:00
launcher.h Build our runtime. 2016-04-24 14:47:24 -04:00
launcher.m [Do not merge yet] Update to mono 2017-04 branch (#1960) 2017-05-29 18:39:29 +02:00
libmonotouch.csproj Fix solutions & projects as VSfM wants them. (#2821) 2017-10-02 11:57:50 +02:00
libxammac.csproj [Mac] Add support for os x extensions (#83) 2016-05-25 17:20:33 -04:00
main-internal.h [Mac] Add support for os x extensions (#83) 2016-05-25 17:20:33 -04:00
mono-runtime.h.t4 [runtime] Use the native equivalent of Type.GetTypeCode to do fewer string comparisons. 2017-07-06 20:27:12 +02:00
mono-runtime.m.t4 [runtime] Call mono_raise_exception if mono_set_pending_exception isn't available. Works around bug #59979 (#2845) 2017-10-05 18:13:44 +02:00
monotouch-debug.h [runtime] Only enable debugging on watchOS devices if a native debugger is also attached. 2016-09-05 10:05:00 +02:00
monotouch-debug.m [runtime] Store the launch mode in a static variable. 2017-05-09 08:12:39 +02:00
monotouch-main.m [runtime] set mono_set_crash_chaining (#2184) 2017-06-27 17:40:30 -04:00
monotouch-support.h [runtime] Add dummy _stret symbols for iOS/ARM64 (#66) 2016-05-18 16:51:45 -04:00
nsstring-localization.m Build our runtime. 2016-04-24 14:47:24 -04:00
product.h Build our runtime. 2016-04-24 14:47:24 -04:00
runtime-internal.h [registrar] Add support for the BindAs attribute. 2017-07-04 07:35:29 +02:00
runtime.m [runtime] Don't hold the framework lock when running managed code. Fixes #59994. (#2848) 2017-10-09 10:59:25 +02:00
shared.h Share the same block descriptors between copies of a block. Fixes #43592. (#683) 2016-08-26 19:22:38 +02:00
shared.m [runtime] Work around static analyzer warning about incorrect refcount decrement. (#1718) 2017-02-20 19:30:23 +01:00
slinked-list.h Build our runtime. 2016-04-24 14:47:24 -04:00
trampolines-i386-asm.s [runtime] Make the existing trampolines exception-aware. 2016-05-17 11:20:26 +02:00
trampolines-i386-objc_msgSend-copyframe.inc [runtime] Don't store xmm registers where we store other registers. 2016-05-17 11:24:02 +02:00
trampolines-i386-objc_msgSend-post.inc [runtime] Make sure the stack is correctly aligned to 16 bytes. 2016-05-17 11:24:03 +02:00
trampolines-i386-objc_msgSend-pre.inc [runtime] Make sure the stack is correctly aligned to 16 bytes. 2016-05-17 11:24:03 +02:00
trampolines-i386-objc_msgSend.s Implement support for exception marshalling. 2016-05-17 11:23:48 +02:00
trampolines-i386-objc_msgSendSuper.s Implement support for exception marshalling. 2016-05-17 11:23:48 +02:00
trampolines-i386-objc_msgSendSuper_stret.s Implement support for exception marshalling. 2016-05-17 11:23:48 +02:00
trampolines-i386-objc_msgSend_stret.s Implement support for exception marshalling. 2016-05-17 11:23:48 +02:00
trampolines-i386.h Build our runtime. 2016-04-24 14:47:24 -04:00
trampolines-i386.m [registrar] Add support for the BindAs attribute. 2017-07-04 07:35:29 +02:00
trampolines-internal.h [registrar] Add support for the BindAs attribute. 2017-07-04 07:35:29 +02:00
trampolines-invoke.m Merge remote-tracking branch 'origin/master' into bindas-registrar-support 2017-09-22 10:50:07 +02:00
trampolines-varargs.h Build our runtime. 2016-04-24 14:47:24 -04:00
trampolines-varargs.m [registrar] Add support for the BindAs attribute. 2017-07-04 07:35:29 +02:00
trampolines-x86_64-asm.s [runtime] Make the existing trampolines exception-aware. 2016-05-17 11:20:26 +02:00
trampolines-x86_64-objc_msgSend-copyframe.inc Implement support for exception marshalling. 2016-05-17 11:23:48 +02:00
trampolines-x86_64-objc_msgSend-post.inc Implement support for exception marshalling. 2016-05-17 11:23:48 +02:00
trampolines-x86_64-objc_msgSend-pre.inc Implement support for exception marshalling. 2016-05-17 11:23:48 +02:00
trampolines-x86_64-objc_msgSend.s Implement support for exception marshalling. 2016-05-17 11:23:48 +02:00
trampolines-x86_64-objc_msgSendSuper.s Implement support for exception marshalling. 2016-05-17 11:23:48 +02:00
trampolines-x86_64-objc_msgSendSuper_stret.s Implement support for exception marshalling. 2016-05-17 11:23:48 +02:00
trampolines-x86_64-objc_msgSend_stret.s Implement support for exception marshalling. 2016-05-17 11:23:48 +02:00
trampolines-x86_64.h Build our runtime. 2016-04-24 14:47:24 -04:00
trampolines-x86_64.m Merge remote-tracking branch 'origin/master' into bindas-registrar-support 2017-09-22 10:50:07 +02:00
trampolines.m Add support for NSDirectionalEdgeInsets NSValues to the BindAs attribute. 2017-09-25 16:06:50 +02:00
xamarin-support.m [runtime] Fix bug 52308 Console.WriteLine text is not showing in Device Log. (#1821) 2017-03-03 14:19:23 -06:00

README.md

Native runtime

This directory contains the native runtime for Xamarin.iOS and Xamarin.Mac.

Cooperative GC

See COOP.md

Generated code

A few files are generated automatically:

delegates.h|inc, Delegates.cs

These files contain the code required to glue the native runtime and the managed runtime.

mono-runtime.m, xamarin/mono-runtime.h

These files contain code that makes other code, consumers of the mono runtime, oblivious to whether the mono runtime is linked statically, dynamically, or using dlopen at runtime.

If you need to use a new function from the Mono headers, add it to exports.t4.

If you need a new enum / constant / typedef / etc, add it to mono-runtime.h.t4.

Shipped headers

These are the headers shipped with XI/XM (they're not for public consumption, but we need them to build generated code on customers machine, in particular main.m and registrar.m)

xamarin/runtime.h xamarin/trampolines.h xamarin/main.h xamarin/xamarin.h