This repository was archived by the owner on Aug 31, 2021. It is now read-only.
Commit 4c4fb21
committed
[[ Bug 20124 ]] Add thread affinity for iOS
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.1 parent 37d7609 commit 4c4fb21
File tree
18 files changed
+760
-276
lines changed- Installer
- config
- docs
- guides
- lcb/notes
- engine/src
- extensions
- widgets
- iosbutton
- notes
- macbutton/notes
- libfoundation
- include
- src
- libscript/src
18 files changed
+760
-276
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
392 | 392 | | |
393 | 393 | | |
394 | 394 | | |
| 395 | + | |
| 396 | + | |
395 | 397 | | |
396 | 398 | | |
397 | 399 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
84 | 85 | | |
85 | 86 | | |
86 | 87 | | |
87 | | - | |
| 88 | + | |
88 | 89 | | |
89 | 90 | | |
90 | 91 | | |
| |||
99 | 100 | | |
100 | 101 | | |
101 | 102 | | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
102 | 121 | | |
103 | 122 | | |
104 | 123 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
444 | 444 | | |
445 | 445 | | |
446 | 446 | | |
447 | | - | |
448 | | - | |
| 447 | + | |
| 448 | + | |
449 | 449 | | |
450 | | - | |
| 450 | + | |
451 | 451 | | |
452 | 452 | | |
453 | 453 | | |
| |||
457 | 457 | | |
458 | 458 | | |
459 | 459 | | |
460 | | - | |
| 460 | + | |
461 | 461 | | |
462 | 462 | | |
463 | 463 | | |
| |||
468 | 468 | | |
469 | 469 | | |
470 | 470 | | |
471 | | - | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
472 | 486 | | |
473 | 487 | | |
474 | 488 | | |
| |||
515 | 529 | | |
516 | 530 | | |
517 | 531 | | |
518 | | - | |
519 | | - | |
| 532 | + | |
| 533 | + | |
520 | 534 | | |
521 | 535 | | |
522 | 536 | | |
| |||
525 | 539 | | |
526 | 540 | | |
527 | 541 | | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | | - | |
532 | | - | |
533 | | - | |
534 | | - | |
535 | 542 | | |
536 | 543 | | |
537 | 544 | | |
538 | 545 | | |
539 | | - | |
| 546 | + | |
540 | 547 | | |
541 | 548 | | |
542 | 549 | | |
| |||
561 | 568 | | |
562 | 569 | | |
563 | 570 | | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
564 | 591 | | |
565 | 592 | | |
566 | 593 | | |
| |||
665 | 692 | | |
666 | 693 | | |
667 | 694 | | |
668 | | - | |
669 | | - | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
670 | 698 | | |
671 | 699 | | |
672 | 700 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | 38 | | |
57 | 39 | | |
58 | 40 | | |
59 | 41 | | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
84 | 45 | | |
85 | 46 | | |
86 | 47 | | |
| |||
93 | 54 | | |
94 | 55 | | |
95 | 56 | | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
| 57 | + | |
107 | 58 | | |
108 | 59 | | |
109 | 60 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
217 | 222 | | |
218 | 223 | | |
219 | 224 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
0 commit comments