Commit 5dca24c
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 5dca24c
File tree
3 files changed
+91
-3
lines changed- src/lib
- system/lib/pthread
- tools
3 files changed
+91
-3
lines changed| 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 | + | |
| 627 | + | |
611 | 628 | | |
612 | 629 | | |
613 | 630 | | |
614 | 631 | | |
615 | | - | |
| 632 | + | |
| 633 | + | |
616 | 634 | | |
617 | 635 | | |
618 | 636 | | |
| |||
633 | 651 | | |
634 | 652 | | |
635 | 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 | + | |
| 679 | + | |
636 | 680 | | |
637 | 681 | | |
638 | 682 | | |
| |||
644 | 688 | | |
645 | 689 | | |
646 | 690 | | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
647 | 694 | | |
| 695 | + | |
648 | 696 | | |
649 | 697 | | |
650 | 698 | | |
651 | 699 | | |
652 | 700 | | |
653 | | - | |
654 | | - | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
655 | 708 | | |
656 | 709 | | |
657 | 710 | | |
| |||
| 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