Commit 71a0e98
committed
select: enable to handle timeout
This commit enables the select syscall to handle timeout with multiple event
sources when PROXY_TO_PTHREAD is enabled.
When a thread worker calls __syscall_newselect, it blocks using
emscripten_proxy_sync_with_ctx. When __syscall_newselect is called with zero
timeout, it is unblocked immediately by calling emscripten_proxy_finish
before returning. When it is called with non-zero timeout,
emscripten_proxy_finish is invoked either by the underlying stream
implementation (where an event occurs) or by a setTimeout callback when the
tiemout expires.
In proxying.c, several wrapper functions for proxying-related APIs are added
to allow the JS implementation of newselect to use them.
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>1 parent 96dd87d commit 71a0e98
File tree
5 files changed
+93
-3
lines changed- src/lib
- system/lib
- libc
- pthread
- tools
5 files changed
+93
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
381 | 381 | | |
382 | 382 | | |
383 | 383 | | |
| 384 | + | |
384 | 385 | | |
385 | 386 | | |
386 | 387 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
607 | 607 | | |
608 | 608 | | |
609 | 609 | | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
610 | 613 | | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
611 | 627 | | |
612 | 628 | | |
613 | 629 | | |
614 | 630 | | |
615 | | - | |
| 631 | + | |
| 632 | + | |
616 | 633 | | |
617 | 634 | | |
618 | 635 | | |
| |||
633 | 650 | | |
634 | 651 | | |
635 | 652 | | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
636 | 679 | | |
637 | 680 | | |
638 | 681 | | |
| |||
644 | 687 | | |
645 | 688 | | |
646 | 689 | | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
647 | 693 | | |
| 694 | + | |
648 | 695 | | |
649 | 696 | | |
650 | 697 | | |
651 | 698 | | |
652 | 699 | | |
653 | | - | |
654 | | - | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
655 | 707 | | |
656 | 708 | | |
657 | 709 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| 154 | + | |
| 155 | + | |
154 | 156 | | |
155 | 157 | | |
156 | 158 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
658 | 658 | | |
659 | 659 | | |
660 | 660 | | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1106 | 1106 | | |
1107 | 1107 | | |
1108 | 1108 | | |
| 1109 | + | |
| 1110 | + | |
1109 | 1111 | | |
1110 | 1112 | | |
1111 | 1113 | | |
| |||
0 commit comments