Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch tip-455 Excluding Merge-Ins
This is equivalent to a diff from 0f133e4c3a to 2bfd9a1fd3
2022-09-19
| ||
13:38 | TIP #455 implementation: Extensions to [vwait]: Variable Sets and Scripted Access to Tcl_DoOneEvent check-in: dedef011c9 user: jan.nijtmans tags: core-8-branch | |
2022-09-01
| ||
14:49 | Change refCount (in ListStore/ListSpan) to size_t. More ClientData -> void *. Eliminate warning abou... check-in: 4f61de7eb7 user: jan.nijtmans tags: core-8-branch | |
2022-08-31
| ||
16:19 | Merge 8.7 check-in: 288c451523 user: kjnash tags: tip-579-8-7 | |
10:55 | TIP #455 proposed implementation Closed-Leaf check-in: 2bfd9a1fd3 user: jan.nijtmans tags: tip-455 | |
10:06 | Merge 8.7 check-in: 6d8032a094 user: jan.nijtmans tags: trunk, main | |
10:05 | Merge 8.6 check-in: 0f133e4c3a user: jan.nijtmans tags: core-8-branch | |
10:03 | Fix [0aa7638534]: .gitignore ignores library/tcltest.tcl check-in: 88ba977d2d user: jan.nijtmans tags: core-8-6-branch | |
2022-08-30
| ||
23:02 | Apply patch 0006 from [37108037b9]: Code cleanups to support CHERI check-in: 5fcc28ca35 user: jan.nijtmans tags: core-8-branch | |
Changes to doc/vwait.n.
︙ | |||
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + | .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME vwait \- Process events until a variable is written .SH SYNOPSIS \fBvwait\fR \fIvarName\fR .PP \fBvwait\fR ?\Ioptions\fR? ?\fIvarName ...\fR? .BE .SH DESCRIPTION .PP This command enters the Tcl event loop to process events, blocking the application if no events are ready. It continues processing events until some event handler sets the value of the global variable \fIvarName\fR. Once \fIvarName\fR has been set, the \fBvwait\fR command will return as soon as the event handler that modified \fIvarName\fR completes. The \fIvarName\fR argument is always interpreted as a variable name with respect to the global namespace, but can refer to any namespace's variables if the fully-qualified name is given. .PP In the second more complex command form \fIoptions\fR allow for finer control of the wait operation and to deal with multiple event sources. \fIOptions\fR can be made up of .TP \fB\-\-\fR . Marks the end of options. All following arguments are handled as variable names. .TP \fB\-all\fR . All conditions for the wait operation must be met to complete the wait operation. Otherwise (the default) the first event completes the wait. .TP \fB\-extended\fR . An extended result in list form is returned, see below for explanation. .TP \fB\-nofileevents\fR . File events are not handled in the wait operation. .TP \fB\-noidleevents\fR . Idle handlers are not invoked during the wait operation. .TP \fB\-notimerevents\fR . Timer handlers are not serviced during the wait operation. .TP \fB\-nowindowevents\fR . Events of the windowing system are not handled during the wait operation. .TP \fB\-readable\fR \fIchannel\fR . \fIChannel\fR must name a Tcl channel open for reading. If \fIchannel\fR is or becomes readable the wait operation completes. .TP \fB\-timeout\fR milliseconds\fR . The wait operation is constrained to \fImilliseconds\fR. .TP \fB\-variable\fR \fIvarName\fR . \fIVarName\fR must be the name of a global variable. Writing or unsetting this variable completes the wait operation. .TP \fB\-writable\fR \fIchannel\fR . \fIChannel\fR must name a Tcl channel open for writing. If \fIchannel\fR is or becomes writable the wait operation completes. .PP The result returned by \fBvwait\fR is for the simple form an empty string. If the \fI\-timeout\fR option is specified, the result is the number of milliseconds remaining when the wait condition has been met, or -1 if the wait operation timed out. .PP If the \fI\-extended\fR option is specified, the result is made up of a Tcl list with an even number of elements. Odd elements take the values \fBreadable\fR, \fBtimeleft\fR, \fBvariable\fR, and \fBwritable\fR. Even elements are the corresponding variable and channel names or the remaining number of milliseconds. The list is ordered by the occurrences of the event(s) with the exception of \fBtimeleft\fR which always comes last. .PP In some cases the \fBvwait\fR command may not return immediately |
︙ |
Changes to generic/tclEvent.c.
︙ | |||
45 46 47 48 49 50 51 52 53 54 55 56 57 58 | 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | + + + + + + + + + + + + + | * waiting to be processed for this * interpreter (NULL if none). */ BgError *lastBgPtr; /* Last in list of all background errors * waiting to be processed for this * interpreter (NULL if none). */ } ErrAssocData; /* * For each "vwait" event source a structure of the following type * is used: */ typedef struct { int *donePtr; /* Pointer to flag to signal or NULL. */ int sequence; /* Order of occurrence. */ int mask; /* 0, or TCL_READABLE/TCL_WRITABLE. */ Tcl_Obj *sourceObj; /* Name of the event source, either a * variable name or channel name. */ } VwaitItem; /* * For each exit handler created with a call to Tcl_Create(Late)ExitHandler * there is a structure of the following type: */ typedef struct ExitHandler { Tcl_ExitProc *proc; /* Function to call when process exits. */ |
︙ | |||
112 113 114 115 116 117 118 119 120 121 122 123 124 125 | 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 | + + + | /* * Prototypes for functions referenced only in this file: */ static void BgErrorDeleteProc(void *clientData, Tcl_Interp *interp); static void HandleBgErrors(void *clientData); static void VwaitChannelReadProc(void *clientData, int mask); static void VwaitChannelWriteProc(void *clientData, int mask); static void VwaitTimeoutProc(void *clientData); static char * VwaitVarProc(void *clientData, Tcl_Interp *interp, const char *name1, const char *name2, int flags); static void InvokeExitHandlers(void); static void FinalizeThread(int quick); /* |
︙ | |||
1483 1484 1485 1486 1487 1488 1489 | 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 | - - - + + + + + + + + + + - - - - + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + - + - - - + - - - + + + + - + + + - + + + - - + + + + + + + + + + - + - + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + + + + - + + | int Tcl_VwaitObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { |
︙ |
Changes to tests/event.test.
︙ | |||
505 506 507 508 509 510 511 | 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 | - + - + - - - | test event-10.1 {Tcl_Exit procedure} {stdio} { set child [open |[list [interpreter]] r+] puts $child "exit 3" list [catch {close $child} msg] $msg [lindex $::errorCode 0] \ [lindex $::errorCode 2] } {1 {child process exited abnormally} CHILDSTATUS 3} |
︙ |