You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This patch generalizes the idea of 'thread affinity' introduced
to Java FFI for Android, to cover Obj-C and C foreign handlers as
well.
Java specific types and functions have been renamed to be more general
MCScriptThreadAffinity enum based - and the Java code refactored to
use it.
Two C defines CROSS_COMPILE_TARGET and CROSS_COMPILE_HOST have been
added, which one depends on whether the target is being compiled
in host or target mode. This is required as GYP generates Xcode
projects which build HOST using TARGET defines (e.g. lc-compile is
compiled for Mac as if it were targetting iOS).
There are now External variants of the HandlerInvoke APIs which
will ensure that the HandlerRef is called on the engine thread, and
the Obj-C and Java interop code which may call handlers from the
ui thread now use them.
Similarly, thread jumping is now done either at the point of handler
invocation in LCB, or at the point of external HandlerRef invocation
from outside of LCB. Essentially, LCB always presumes it is running
code on the engine thread (like LCS does).
By way of a test, a native iOS button has been added.
* It is now possible to specify the thread to be used in Obj-C foreign handlers. This is done by appending `?<thread>` to the end of the binding string. Currently the only supported value is `ui`, for running the handler on the iOS main thread, as opposed to the engine thread.
0 commit comments