summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/Utf.32
-rw-r--r--doc/regexp.n2
-rw-r--r--library/tzdata/America/Montevideo169
-rw-r--r--library/tzdata/Asia/Pyongyang1
-rw-r--r--library/tzdata/Atlantic/Canary1
-rw-r--r--library/tzdata/Europe/Chisinau412
-rw-r--r--library/tzdata/Europe/Simferopol1
-rw-r--r--library/tzdata/Europe/Sofia1
-rw-r--r--library/tzdata/Europe/Tallinn3
-rw-r--r--unix/tclUnixNotfy.c402
10 files changed, 409 insertions, 585 deletions
diff --git a/doc/Utf.3 b/doc/Utf.3
index 3b2ef91..9b506f4 100644
--- a/doc/Utf.3
+++ b/doc/Utf.3
@@ -8,7 +8,7 @@
.so man.macros
.BS
.SH NAME
-Tcl_UniChar, Tcl_UniCharCaseMatch, Tcl_UniCharNcasecmp, Tcl_UniCharToUtf, Tcl_UtfToUniChar, Tcl_UniCharToUtfDString, Tcl_UtfToUniCharDString, Tcl_UniCharLen, Tcl_UniCharNcmp, Tcl_UtfCharComplete, Tcl_NumUtfChars, Tcl_UtfFindFirst, Tcl_UtfFindLast, Tcl_UtfNext, Tcl_UtfPrev, Tcl_UniCharAtIndex, Tcl_UtfAtIndex, Tcl_UtfBackslash \- routines for manipulating UTF-8 strings
+Tcl_UniChar, Tcl_UniCharToUtf, Tcl_UtfToUniChar, Tcl_UniCharToUtfDString, Tcl_UtfToUniCharDString, Tcl_UniCharLen, Tcl_UniCharNcmp, Tcl_UniCharNcasecmp, Tcl_UniCharCaseMatch, Tcl_UtfNcmp, Tcl_UtfNcasecmp, Tcl_UtfCharComplete, Tcl_NumUtfChars, Tcl_UtfFindFirst, Tcl_UtfFindLast, Tcl_UtfNext, Tcl_UtfPrev, Tcl_UniCharAtIndex, Tcl_UtfAtIndex, Tcl_UtfBackslash \- routines for manipulating UTF-8 strings
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
diff --git a/doc/regexp.n b/doc/regexp.n
index 17bf564..5fc2895 100644
--- a/doc/regexp.n
+++ b/doc/regexp.n
@@ -51,7 +51,7 @@ the \fB(?x)\fR embedded option (see the \fBre_syntax\fR manual page).
.TP 15
\fB\-indices\fR
.
-Changes what is stored in the \fIsubMatchVar\fRs.
+Changes what is stored in the \fImatchVar\fR and \fIsubMatchVar\fRs.
Instead of storing the matching characters from \fIstring\fR,
each variable
will contain a list of two decimal strings giving the indices
diff --git a/library/tzdata/America/Montevideo b/library/tzdata/America/Montevideo
index aa469b9..91a5117 100644
--- a/library/tzdata/America/Montevideo
+++ b/library/tzdata/America/Montevideo
@@ -89,173 +89,4 @@ set TZData(:America/Montevideo) {
{1394337600 -10800 0 UYT}
{1412485200 -7200 1 UYST}
{1425787200 -10800 0 UYT}
- {1443934800 -7200 1 UYST}
- {1457841600 -10800 0 UYT}
- {1475384400 -7200 1 UYST}
- {1489291200 -10800 0 UYT}
- {1506834000 -7200 1 UYST}
- {1520740800 -10800 0 UYT}
- {1538888400 -7200 1 UYST}
- {1552190400 -10800 0 UYT}
- {1570338000 -7200 1 UYST}
- {1583640000 -10800 0 UYT}
- {1601787600 -7200 1 UYST}
- {1615694400 -10800 0 UYT}
- {1633237200 -7200 1 UYST}
- {1647144000 -10800 0 UYT}
- {1664686800 -7200 1 UYST}
- {1678593600 -10800 0 UYT}
- {1696136400 -7200 1 UYST}
- {1710043200 -10800 0 UYT}
- {1728190800 -7200 1 UYST}
- {1741492800 -10800 0 UYT}
- {1759640400 -7200 1 UYST}
- {1772942400 -10800 0 UYT}
- {1791090000 -7200 1 UYST}
- {1804996800 -10800 0 UYT}
- {1822539600 -7200 1 UYST}
- {1836446400 -10800 0 UYT}
- {1853989200 -7200 1 UYST}
- {1867896000 -10800 0 UYT}
- {1886043600 -7200 1 UYST}
- {1899345600 -10800 0 UYT}
- {1917493200 -7200 1 UYST}
- {1930795200 -10800 0 UYT}
- {1948942800 -7200 1 UYST}
- {1962849600 -10800 0 UYT}
- {1980392400 -7200 1 UYST}
- {1994299200 -10800 0 UYT}
- {2011842000 -7200 1 UYST}
- {2025748800 -10800 0 UYT}
- {2043291600 -7200 1 UYST}
- {2057198400 -10800 0 UYT}
- {2075346000 -7200 1 UYST}
- {2088648000 -10800 0 UYT}
- {2106795600 -7200 1 UYST}
- {2120097600 -10800 0 UYT}
- {2138245200 -7200 1 UYST}
- {2152152000 -10800 0 UYT}
- {2169694800 -7200 1 UYST}
- {2183601600 -10800 0 UYT}
- {2201144400 -7200 1 UYST}
- {2215051200 -10800 0 UYT}
- {2233198800 -7200 1 UYST}
- {2246500800 -10800 0 UYT}
- {2264648400 -7200 1 UYST}
- {2277950400 -10800 0 UYT}
- {2296098000 -7200 1 UYST}
- {2309400000 -10800 0 UYT}
- {2327547600 -7200 1 UYST}
- {2341454400 -10800 0 UYT}
- {2358997200 -7200 1 UYST}
- {2372904000 -10800 0 UYT}
- {2390446800 -7200 1 UYST}
- {2404353600 -10800 0 UYT}
- {2422501200 -7200 1 UYST}
- {2435803200 -10800 0 UYT}
- {2453950800 -7200 1 UYST}
- {2467252800 -10800 0 UYT}
- {2485400400 -7200 1 UYST}
- {2499307200 -10800 0 UYT}
- {2516850000 -7200 1 UYST}
- {2530756800 -10800 0 UYT}
- {2548299600 -7200 1 UYST}
- {2562206400 -10800 0 UYT}
- {2579749200 -7200 1 UYST}
- {2593656000 -10800 0 UYT}
- {2611803600 -7200 1 UYST}
- {2625105600 -10800 0 UYT}
- {2643253200 -7200 1 UYST}
- {2656555200 -10800 0 UYT}
- {2674702800 -7200 1 UYST}
- {2688609600 -10800 0 UYT}
- {2706152400 -7200 1 UYST}
- {2720059200 -10800 0 UYT}
- {2737602000 -7200 1 UYST}
- {2751508800 -10800 0 UYT}
- {2769656400 -7200 1 UYST}
- {2782958400 -10800 0 UYT}
- {2801106000 -7200 1 UYST}
- {2814408000 -10800 0 UYT}
- {2832555600 -7200 1 UYST}
- {2846462400 -10800 0 UYT}
- {2864005200 -7200 1 UYST}
- {2877912000 -10800 0 UYT}
- {2895454800 -7200 1 UYST}
- {2909361600 -10800 0 UYT}
- {2926904400 -7200 1 UYST}
- {2940811200 -10800 0 UYT}
- {2958958800 -7200 1 UYST}
- {2972260800 -10800 0 UYT}
- {2990408400 -7200 1 UYST}
- {3003710400 -10800 0 UYT}
- {3021858000 -7200 1 UYST}
- {3035764800 -10800 0 UYT}
- {3053307600 -7200 1 UYST}
- {3067214400 -10800 0 UYT}
- {3084757200 -7200 1 UYST}
- {3098664000 -10800 0 UYT}
- {3116811600 -7200 1 UYST}
- {3130113600 -10800 0 UYT}
- {3148261200 -7200 1 UYST}
- {3161563200 -10800 0 UYT}
- {3179710800 -7200 1 UYST}
- {3193012800 -10800 0 UYT}
- {3211160400 -7200 1 UYST}
- {3225067200 -10800 0 UYT}
- {3242610000 -7200 1 UYST}
- {3256516800 -10800 0 UYT}
- {3274059600 -7200 1 UYST}
- {3287966400 -10800 0 UYT}
- {3306114000 -7200 1 UYST}
- {3319416000 -10800 0 UYT}
- {3337563600 -7200 1 UYST}
- {3350865600 -10800 0 UYT}
- {3369013200 -7200 1 UYST}
- {3382920000 -10800 0 UYT}
- {3400462800 -7200 1 UYST}
- {3414369600 -10800 0 UYT}
- {3431912400 -7200 1 UYST}
- {3445819200 -10800 0 UYT}
- {3463362000 -7200 1 UYST}
- {3477268800 -10800 0 UYT}
- {3495416400 -7200 1 UYST}
- {3508718400 -10800 0 UYT}
- {3526866000 -7200 1 UYST}
- {3540168000 -10800 0 UYT}
- {3558315600 -7200 1 UYST}
- {3572222400 -10800 0 UYT}
- {3589765200 -7200 1 UYST}
- {3603672000 -10800 0 UYT}
- {3621214800 -7200 1 UYST}
- {3635121600 -10800 0 UYT}
- {3653269200 -7200 1 UYST}
- {3666571200 -10800 0 UYT}
- {3684718800 -7200 1 UYST}
- {3698020800 -10800 0 UYT}
- {3716168400 -7200 1 UYST}
- {3730075200 -10800 0 UYT}
- {3747618000 -7200 1 UYST}
- {3761524800 -10800 0 UYT}
- {3779067600 -7200 1 UYST}
- {3792974400 -10800 0 UYT}
- {3810517200 -7200 1 UYST}
- {3824424000 -10800 0 UYT}
- {3842571600 -7200 1 UYST}
- {3855873600 -10800 0 UYT}
- {3874021200 -7200 1 UYST}
- {3887323200 -10800 0 UYT}
- {3905470800 -7200 1 UYST}
- {3919377600 -10800 0 UYT}
- {3936920400 -7200 1 UYST}
- {3950827200 -10800 0 UYT}
- {3968370000 -7200 1 UYST}
- {3982276800 -10800 0 UYT}
- {4000424400 -7200 1 UYST}
- {4013726400 -10800 0 UYT}
- {4031874000 -7200 1 UYST}
- {4045176000 -10800 0 UYT}
- {4063323600 -7200 1 UYST}
- {4076625600 -10800 0 UYT}
- {4094773200 -7200 1 UYST}
}
diff --git a/library/tzdata/Asia/Pyongyang b/library/tzdata/Asia/Pyongyang
index fafed54..4ade8e6 100644
--- a/library/tzdata/Asia/Pyongyang
+++ b/library/tzdata/Asia/Pyongyang
@@ -6,4 +6,5 @@ set TZData(:Asia/Pyongyang) {
{-1830414600 32400 0 JCST}
{-1017824400 32400 0 JST}
{-768646800 32400 0 KST}
+ {1439564400 30600 0 KST}
}
diff --git a/library/tzdata/Atlantic/Canary b/library/tzdata/Atlantic/Canary
index 4b802c7..dcfba83 100644
--- a/library/tzdata/Atlantic/Canary
+++ b/library/tzdata/Atlantic/Canary
@@ -5,7 +5,6 @@ set TZData(:Atlantic/Canary) {
{-1509663504 -3600 0 CANT}
{-733874400 0 0 WET}
{323827200 3600 1 WEST}
- {338947200 3600 0 WEST}
{338950800 0 0 WET}
{354675600 3600 1 WEST}
{370400400 0 0 WET}
diff --git a/library/tzdata/Europe/Chisinau b/library/tzdata/Europe/Chisinau
index 4ef466b..5c240e7 100644
--- a/library/tzdata/Europe/Chisinau
+++ b/library/tzdata/Europe/Chisinau
@@ -63,210 +63,210 @@ set TZData(:Europe/Chisinau) {
{828223200 10800 1 EEST}
{846363600 7200 0 EET}
{852069600 7200 0 EET}
- {859683600 10800 1 EEST}
- {877827600 7200 0 EET}
- {891133200 10800 1 EEST}
- {909277200 7200 0 EET}
- {922582800 10800 1 EEST}
- {941331600 7200 0 EET}
- {954032400 10800 1 EEST}
- {972781200 7200 0 EET}
- {985482000 10800 1 EEST}
- {1004230800 7200 0 EET}
- {1017536400 10800 1 EEST}
- {1035680400 7200 0 EET}
- {1048986000 10800 1 EEST}
- {1067130000 7200 0 EET}
- {1080435600 10800 1 EEST}
- {1099184400 7200 0 EET}
- {1111885200 10800 1 EEST}
- {1130634000 7200 0 EET}
- {1143334800 10800 1 EEST}
- {1162083600 7200 0 EET}
- {1174784400 10800 1 EEST}
- {1193533200 7200 0 EET}
- {1206838800 10800 1 EEST}
- {1224982800 7200 0 EET}
- {1238288400 10800 1 EEST}
- {1256432400 7200 0 EET}
- {1269738000 10800 1 EEST}
- {1288486800 7200 0 EET}
- {1301187600 10800 1 EEST}
- {1319936400 7200 0 EET}
- {1332637200 10800 1 EEST}
- {1351386000 7200 0 EET}
- {1364691600 10800 1 EEST}
- {1382835600 7200 0 EET}
- {1396141200 10800 1 EEST}
- {1414285200 7200 0 EET}
- {1427590800 10800 1 EEST}
- {1445734800 7200 0 EET}
- {1459040400 10800 1 EEST}
- {1477789200 7200 0 EET}
- {1490490000 10800 1 EEST}
- {1509238800 7200 0 EET}
- {1521939600 10800 1 EEST}
- {1540688400 7200 0 EET}
- {1553994000 10800 1 EEST}
- {1572138000 7200 0 EET}
- {1585443600 10800 1 EEST}
- {1603587600 7200 0 EET}
- {1616893200 10800 1 EEST}
- {1635642000 7200 0 EET}
- {1648342800 10800 1 EEST}
- {1667091600 7200 0 EET}
- {1679792400 10800 1 EEST}
- {1698541200 7200 0 EET}
- {1711846800 10800 1 EEST}
- {1729990800 7200 0 EET}
- {1743296400 10800 1 EEST}
- {1761440400 7200 0 EET}
- {1774746000 10800 1 EEST}
- {1792890000 7200 0 EET}
- {1806195600 10800 1 EEST}
- {1824944400 7200 0 EET}
- {1837645200 10800 1 EEST}
- {1856394000 7200 0 EET}
- {1869094800 10800 1 EEST}
- {1887843600 7200 0 EET}
- {1901149200 10800 1 EEST}
- {1919293200 7200 0 EET}
- {1932598800 10800 1 EEST}
- {1950742800 7200 0 EET}
- {1964048400 10800 1 EEST}
- {1982797200 7200 0 EET}
- {1995498000 10800 1 EEST}
- {2014246800 7200 0 EET}
- {2026947600 10800 1 EEST}
- {2045696400 7200 0 EET}
- {2058397200 10800 1 EEST}
- {2077146000 7200 0 EET}
- {2090451600 10800 1 EEST}
- {2108595600 7200 0 EET}
- {2121901200 10800 1 EEST}
- {2140045200 7200 0 EET}
- {2153350800 10800 1 EEST}
- {2172099600 7200 0 EET}
- {2184800400 10800 1 EEST}
- {2203549200 7200 0 EET}
- {2216250000 10800 1 EEST}
- {2234998800 7200 0 EET}
- {2248304400 10800 1 EEST}
- {2266448400 7200 0 EET}
- {2279754000 10800 1 EEST}
- {2297898000 7200 0 EET}
- {2311203600 10800 1 EEST}
- {2329347600 7200 0 EET}
- {2342653200 10800 1 EEST}
- {2361402000 7200 0 EET}
- {2374102800 10800 1 EEST}
- {2392851600 7200 0 EET}
- {2405552400 10800 1 EEST}
- {2424301200 7200 0 EET}
- {2437606800 10800 1 EEST}
- {2455750800 7200 0 EET}
- {2469056400 10800 1 EEST}
- {2487200400 7200 0 EET}
- {2500506000 10800 1 EEST}
- {2519254800 7200 0 EET}
- {2531955600 10800 1 EEST}
- {2550704400 7200 0 EET}
- {2563405200 10800 1 EEST}
- {2582154000 7200 0 EET}
- {2595459600 10800 1 EEST}
- {2613603600 7200 0 EET}
- {2626909200 10800 1 EEST}
- {2645053200 7200 0 EET}
- {2658358800 10800 1 EEST}
- {2676502800 7200 0 EET}
- {2689808400 10800 1 EEST}
- {2708557200 7200 0 EET}
- {2721258000 10800 1 EEST}
- {2740006800 7200 0 EET}
- {2752707600 10800 1 EEST}
- {2771456400 7200 0 EET}
- {2784762000 10800 1 EEST}
- {2802906000 7200 0 EET}
- {2816211600 10800 1 EEST}
- {2834355600 7200 0 EET}
- {2847661200 10800 1 EEST}
- {2866410000 7200 0 EET}
- {2879110800 10800 1 EEST}
- {2897859600 7200 0 EET}
- {2910560400 10800 1 EEST}
- {2929309200 7200 0 EET}
- {2942010000 10800 1 EEST}
- {2960758800 7200 0 EET}
- {2974064400 10800 1 EEST}
- {2992208400 7200 0 EET}
- {3005514000 10800 1 EEST}
- {3023658000 7200 0 EET}
- {3036963600 10800 1 EEST}
- {3055712400 7200 0 EET}
- {3068413200 10800 1 EEST}
- {3087162000 7200 0 EET}
- {3099862800 10800 1 EEST}
- {3118611600 7200 0 EET}
- {3131917200 10800 1 EEST}
- {3150061200 7200 0 EET}
- {3163366800 10800 1 EEST}
- {3181510800 7200 0 EET}
- {3194816400 10800 1 EEST}
- {3212960400 7200 0 EET}
- {3226266000 10800 1 EEST}
- {3245014800 7200 0 EET}
- {3257715600 10800 1 EEST}
- {3276464400 7200 0 EET}
- {3289165200 10800 1 EEST}
- {3307914000 7200 0 EET}
- {3321219600 10800 1 EEST}
- {3339363600 7200 0 EET}
- {3352669200 10800 1 EEST}
- {3370813200 7200 0 EET}
- {3384118800 10800 1 EEST}
- {3402867600 7200 0 EET}
- {3415568400 10800 1 EEST}
- {3434317200 7200 0 EET}
- {3447018000 10800 1 EEST}
- {3465766800 7200 0 EET}
- {3479072400 10800 1 EEST}
- {3497216400 7200 0 EET}
- {3510522000 10800 1 EEST}
- {3528666000 7200 0 EET}
- {3541971600 10800 1 EEST}
- {3560115600 7200 0 EET}
- {3573421200 10800 1 EEST}
- {3592170000 7200 0 EET}
- {3604870800 10800 1 EEST}
- {3623619600 7200 0 EET}
- {3636320400 10800 1 EEST}
- {3655069200 7200 0 EET}
- {3668374800 10800 1 EEST}
- {3686518800 7200 0 EET}
- {3699824400 10800 1 EEST}
- {3717968400 7200 0 EET}
- {3731274000 10800 1 EEST}
- {3750022800 7200 0 EET}
- {3762723600 10800 1 EEST}
- {3781472400 7200 0 EET}
- {3794173200 10800 1 EEST}
- {3812922000 7200 0 EET}
- {3825622800 10800 1 EEST}
- {3844371600 7200 0 EET}
- {3857677200 10800 1 EEST}
- {3875821200 7200 0 EET}
- {3889126800 10800 1 EEST}
- {3907270800 7200 0 EET}
- {3920576400 10800 1 EEST}
- {3939325200 7200 0 EET}
- {3952026000 10800 1 EEST}
- {3970774800 7200 0 EET}
- {3983475600 10800 1 EEST}
- {4002224400 7200 0 EET}
- {4015530000 10800 1 EEST}
- {4033674000 7200 0 EET}
- {4046979600 10800 1 EEST}
- {4065123600 7200 0 EET}
- {4078429200 10800 1 EEST}
- {4096573200 7200 0 EET}
+ {859680000 10800 1 EEST}
+ {877824000 7200 0 EET}
+ {891129600 10800 1 EEST}
+ {909273600 7200 0 EET}
+ {922579200 10800 1 EEST}
+ {941328000 7200 0 EET}
+ {954028800 10800 1 EEST}
+ {972777600 7200 0 EET}
+ {985478400 10800 1 EEST}
+ {1004227200 7200 0 EET}
+ {1017532800 10800 1 EEST}
+ {1035676800 7200 0 EET}
+ {1048982400 10800 1 EEST}
+ {1067126400 7200 0 EET}
+ {1080432000 10800 1 EEST}
+ {1099180800 7200 0 EET}
+ {1111881600 10800 1 EEST}
+ {1130630400 7200 0 EET}
+ {1143331200 10800 1 EEST}
+ {1162080000 7200 0 EET}
+ {1174780800 10800 1 EEST}
+ {1193529600 7200 0 EET}
+ {1206835200 10800 1 EEST}
+ {1224979200 7200 0 EET}
+ {1238284800 10800 1 EEST}
+ {1256428800 7200 0 EET}
+ {1269734400 10800 1 EEST}
+ {1288483200 7200 0 EET}
+ {1301184000 10800 1 EEST}
+ {1319932800 7200 0 EET}
+ {1332633600 10800 1 EEST}
+ {1351382400 7200 0 EET}
+ {1364688000 10800 1 EEST}
+ {1382832000 7200 0 EET}
+ {1396137600 10800 1 EEST}
+ {1414281600 7200 0 EET}
+ {1427587200 10800 1 EEST}
+ {1445731200 7200 0 EET}
+ {1459036800 10800 1 EEST}
+ {1477785600 7200 0 EET}
+ {1490486400 10800 1 EEST}
+ {1509235200 7200 0 EET}
+ {1521936000 10800 1 EEST}
+ {1540684800 7200 0 EET}
+ {1553990400 10800 1 EEST}
+ {1572134400 7200 0 EET}
+ {1585440000 10800 1 EEST}
+ {1603584000 7200 0 EET}
+ {1616889600 10800 1 EEST}
+ {1635638400 7200 0 EET}
+ {1648339200 10800 1 EEST}
+ {1667088000 7200 0 EET}
+ {1679788800 10800 1 EEST}
+ {1698537600 7200 0 EET}
+ {1711843200 10800 1 EEST}
+ {1729987200 7200 0 EET}
+ {1743292800 10800 1 EEST}
+ {1761436800 7200 0 EET}
+ {1774742400 10800 1 EEST}
+ {1792886400 7200 0 EET}
+ {1806192000 10800 1 EEST}
+ {1824940800 7200 0 EET}
+ {1837641600 10800 1 EEST}
+ {1856390400 7200 0 EET}
+ {1869091200 10800 1 EEST}
+ {1887840000 7200 0 EET}
+ {1901145600 10800 1 EEST}
+ {1919289600 7200 0 EET}
+ {1932595200 10800 1 EEST}
+ {1950739200 7200 0 EET}
+ {1964044800 10800 1 EEST}
+ {1982793600 7200 0 EET}
+ {1995494400 10800 1 EEST}
+ {2014243200 7200 0 EET}
+ {2026944000 10800 1 EEST}
+ {2045692800 7200 0 EET}
+ {2058393600 10800 1 EEST}
+ {2077142400 7200 0 EET}
+ {2090448000 10800 1 EEST}
+ {2108592000 7200 0 EET}
+ {2121897600 10800 1 EEST}
+ {2140041600 7200 0 EET}
+ {2153347200 10800 1 EEST}
+ {2172096000 7200 0 EET}
+ {2184796800 10800 1 EEST}
+ {2203545600 7200 0 EET}
+ {2216246400 10800 1 EEST}
+ {2234995200 7200 0 EET}
+ {2248300800 10800 1 EEST}
+ {2266444800 7200 0 EET}
+ {2279750400 10800 1 EEST}
+ {2297894400 7200 0 EET}
+ {2311200000 10800 1 EEST}
+ {2329344000 7200 0 EET}
+ {2342649600 10800 1 EEST}
+ {2361398400 7200 0 EET}
+ {2374099200 10800 1 EEST}
+ {2392848000 7200 0 EET}
+ {2405548800 10800 1 EEST}
+ {2424297600 7200 0 EET}
+ {2437603200 10800 1 EEST}
+ {2455747200 7200 0 EET}
+ {2469052800 10800 1 EEST}
+ {2487196800 7200 0 EET}
+ {2500502400 10800 1 EEST}
+ {2519251200 7200 0 EET}
+ {2531952000 10800 1 EEST}
+ {2550700800 7200 0 EET}
+ {2563401600 10800 1 EEST}
+ {2582150400 7200 0 EET}
+ {2595456000 10800 1 EEST}
+ {2613600000 7200 0 EET}
+ {2626905600 10800 1 EEST}
+ {2645049600 7200 0 EET}
+ {2658355200 10800 1 EEST}
+ {2676499200 7200 0 EET}
+ {2689804800 10800 1 EEST}
+ {2708553600 7200 0 EET}
+ {2721254400 10800 1 EEST}
+ {2740003200 7200 0 EET}
+ {2752704000 10800 1 EEST}
+ {2771452800 7200 0 EET}
+ {2784758400 10800 1 EEST}
+ {2802902400 7200 0 EET}
+ {2816208000 10800 1 EEST}
+ {2834352000 7200 0 EET}
+ {2847657600 10800 1 EEST}
+ {2866406400 7200 0 EET}
+ {2879107200 10800 1 EEST}
+ {2897856000 7200 0 EET}
+ {2910556800 10800 1 EEST}
+ {2929305600 7200 0 EET}
+ {2942006400 10800 1 EEST}
+ {2960755200 7200 0 EET}
+ {2974060800 10800 1 EEST}
+ {2992204800 7200 0 EET}
+ {3005510400 10800 1 EEST}
+ {3023654400 7200 0 EET}
+ {3036960000 10800 1 EEST}
+ {3055708800 7200 0 EET}
+ {3068409600 10800 1 EEST}
+ {3087158400 7200 0 EET}
+ {3099859200 10800 1 EEST}
+ {3118608000 7200 0 EET}
+ {3131913600 10800 1 EEST}
+ {3150057600 7200 0 EET}
+ {3163363200 10800 1 EEST}
+ {3181507200 7200 0 EET}
+ {3194812800 10800 1 EEST}
+ {3212956800 7200 0 EET}
+ {3226262400 10800 1 EEST}
+ {3245011200 7200 0 EET}
+ {3257712000 10800 1 EEST}
+ {3276460800 7200 0 EET}
+ {3289161600 10800 1 EEST}
+ {3307910400 7200 0 EET}
+ {3321216000 10800 1 EEST}
+ {3339360000 7200 0 EET}
+ {3352665600 10800 1 EEST}
+ {3370809600 7200 0 EET}
+ {3384115200 10800 1 EEST}
+ {3402864000 7200 0 EET}
+ {3415564800 10800 1 EEST}
+ {3434313600 7200 0 EET}
+ {3447014400 10800 1 EEST}
+ {3465763200 7200 0 EET}
+ {3479068800 10800 1 EEST}
+ {3497212800 7200 0 EET}
+ {3510518400 10800 1 EEST}
+ {3528662400 7200 0 EET}
+ {3541968000 10800 1 EEST}
+ {3560112000 7200 0 EET}
+ {3573417600 10800 1 EEST}
+ {3592166400 7200 0 EET}
+ {3604867200 10800 1 EEST}
+ {3623616000 7200 0 EET}
+ {3636316800 10800 1 EEST}
+ {3655065600 7200 0 EET}
+ {3668371200 10800 1 EEST}
+ {3686515200 7200 0 EET}
+ {3699820800 10800 1 EEST}
+ {3717964800 7200 0 EET}
+ {3731270400 10800 1 EEST}
+ {3750019200 7200 0 EET}
+ {3762720000 10800 1 EEST}
+ {3781468800 7200 0 EET}
+ {3794169600 10800 1 EEST}
+ {3812918400 7200 0 EET}
+ {3825619200 10800 1 EEST}
+ {3844368000 7200 0 EET}
+ {3857673600 10800 1 EEST}
+ {3875817600 7200 0 EET}
+ {3889123200 10800 1 EEST}
+ {3907267200 7200 0 EET}
+ {3920572800 10800 1 EEST}
+ {3939321600 7200 0 EET}
+ {3952022400 10800 1 EEST}
+ {3970771200 7200 0 EET}
+ {3983472000 10800 1 EEST}
+ {4002220800 7200 0 EET}
+ {4015526400 10800 1 EEST}
+ {4033670400 7200 0 EET}
+ {4046976000 10800 1 EEST}
+ {4065120000 7200 0 EET}
+ {4078425600 10800 1 EEST}
+ {4096569600 7200 0 EET}
}
diff --git a/library/tzdata/Europe/Simferopol b/library/tzdata/Europe/Simferopol
index f6431fa..3e4b60a 100644
--- a/library/tzdata/Europe/Simferopol
+++ b/library/tzdata/Europe/Simferopol
@@ -42,7 +42,6 @@ set TZData(:Europe/Simferopol) {
{796165200 14400 1 MSD}
{811886400 10800 0 MSK}
{828219600 14400 1 MSD}
- {828230400 14400 1 MSD}
{852066000 10800 0 MSK}
{859683600 10800 0 EEST}
{877827600 7200 0 EET}
diff --git a/library/tzdata/Europe/Sofia b/library/tzdata/Europe/Sofia
index 8fd55f6..a07f3bc 100644
--- a/library/tzdata/Europe/Sofia
+++ b/library/tzdata/Europe/Sofia
@@ -18,7 +18,6 @@ set TZData(:Europe/Sofia) {
{355266000 10800 1 EEST}
{370393200 7200 0 EET}
{386715600 10800 1 EEST}
- {401842800 10800 0 EEST}
{401846400 7200 0 EET}
{417571200 10800 1 EEST}
{433296000 7200 0 EET}
diff --git a/library/tzdata/Europe/Tallinn b/library/tzdata/Europe/Tallinn
index 17f14e6..e0f22a5 100644
--- a/library/tzdata/Europe/Tallinn
+++ b/library/tzdata/Europe/Tallinn
@@ -53,8 +53,7 @@ set TZData(:Europe/Tallinn) {
{906415200 10800 0 EEST}
{909277200 7200 0 EET}
{922582800 10800 1 EEST}
- {941331600 7200 0 EET}
- {941407200 7200 0 EET}
+ {941335200 7200 0 EET}
{1014242400 7200 0 EET}
{1017536400 10800 1 EEST}
{1035680400 7200 0 EET}
diff --git a/unix/tclUnixNotfy.c b/unix/tclUnixNotfy.c
index a09899f..075b849 100644
--- a/unix/tclUnixNotfy.c
+++ b/unix/tclUnixNotfy.c
@@ -1,6 +1,5 @@
-#define LAZY_THREAD_CREATE 1
#define AT_FORK_INIT_VALUE 0
-#define DEACTIVATE_ATFORK_MUTEX 0
+#define RESET_ATFORK_MUTEX 1
/*
* tclUnixNotify.c --
*
@@ -18,6 +17,7 @@
#ifndef HAVE_COREFOUNDATION /* Darwin/Mac OS X CoreFoundation notifier is
* in tclMacOSXNotify.c */
#include <signal.h>
+#include <assert.h>
/*
* This structure is used to keep track of the notifier info for a registered
@@ -100,9 +100,10 @@ typedef struct ThreadSpecificData {
* by sending this event. */
void *hwnd; /* Messaging window. */
#else /* !__CYGWIN__ */
- Tcl_Condition waitCV; /* Any other thread alerts a notifier that an
+ pthread_cond_t waitCV; /* Any other thread alerts a notifier that an
* event is ready to be processed by signaling
* this condition variable. */
+ int waitCVinitialized; /* Variable to flag initialization of the structure */
#endif /* __CYGWIN__ */
int eventReady; /* True if an event is ready to be processed.
* Used as condition flag together with waitCV
@@ -119,19 +120,9 @@ static Tcl_ThreadDataKey dataKey;
*
* You must hold the notifierMutex lock before accessing this variable.
*/
-
static int notifierCount = 0;
/*
- * The following static stores the process ID of the initialized notifier
- * thread. If it changes, we have passed a fork and we should start a new
- * notifier thread.
- *
- * You must hold the notifierMutex lock before accessing this variable.
- */
-static pid_t processIDInitialized = 0;
-
-/*
* The following variable points to the head of a doubly-linked list of
* ThreadSpecificData structures for all threads that are currently waiting on
* an event.
@@ -161,27 +152,22 @@ static int triggerPipe = -1;
* The notifierMutex locks access to all of the global notifier state.
*/
-TCL_DECLARE_MUTEX(notifierMutex)
-
-#if LAZY_THREAD_CREATE == 1
-TCL_DECLARE_MUTEX(notifierInitMutex)
-
+pthread_mutex_t notifierInitMutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t notifierMutex = PTHREAD_MUTEX_INITIALIZER;
/*
* The following static indicates if the notifier thread is running.
*
- * You must hold the notifierInitLock before accessing this variable.
+ * You must hold the notifierInitMutex before accessing this variable.
*/
static int notifierThreadRunning = 0;
-#endif
/*
* The notifier thread signals the notifierCV when it has finished
* initializing the triggerPipe and right before the notifier thread
* terminates.
*/
-
-static Tcl_Condition notifierCV;
+static pthread_cond_t notifierCV = PTHREAD_COND_INITIALIZER;
/*
* The pollState bits
@@ -273,32 +259,50 @@ static DWORD __stdcall NotifierProc(void *hwnd, unsigned int message,
void *wParam, void *lParam);
#endif /* TCL_THREADS && __CYGWIN__ */
-#if LAZY_THREAD_CREATE == 1
+
+#if TCL_THREADS
+/*
+ *----------------------------------------------------------------------
+ *
+ * StartNotifierThread --
+ *
+ * Start a notfier thread and wait for the notifier pipe to be created.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Running Thread.
+ *
+ *----------------------------------------------------------------------
+ */
static void
StartNotifierThread(void)
{
- fprintf(stderr, "=== StartNotifierThread()\n");
- Tcl_MutexLock(&notifierInitMutex);
- TclpMasterLock();
- TclpMutexLock();
- fprintf(stderr, "=== StartNotifierThread() locked notifierThreadRunning %d notifierCount %d\n", notifierThreadRunning, notifierCount);
- if (!notifierCount) {
- Tcl_Panic("StartNotifierThread: notifier not initialized");
- }
+
+ pthread_mutex_lock(&notifierInitMutex);
if (!notifierThreadRunning) {
- fprintf(stderr, "=== StartNotifierThread() really start\n");
- if (TclpThreadCreate(&notifierThread, NotifierThreadProc, NULL,
- TCL_THREAD_STACK_DEFAULT, TCL_THREAD_JOINABLE) != TCL_OK) {
- Tcl_Panic("Tcl_InitNotifier: unable to start notifier thread");
- }
- processIDInitialized = getpid();
- notifierThreadRunning = 1;
+ fprintf(stderr, "=== StartNotifierThread()\n");
+ if (TclpThreadCreate(&notifierThread, NotifierThreadProc, NULL,
+ TCL_THREAD_STACK_DEFAULT, TCL_THREAD_JOINABLE) != TCL_OK) {
+ Tcl_Panic("Tcl_InitNotifier: unable to start notifier thread");
+ }
+
+ pthread_mutex_lock(&notifierMutex);
+ /*
+ * Wait for the notifier pipe to be created.
+ */
+
+ while (triggerPipe < 0) {
+ pthread_cond_wait(&notifierCV, &notifierMutex);
+ }
+ pthread_mutex_unlock(&notifierMutex);
+
+ notifierThreadRunning = 1;
}
- TclpMutexUnlock();
- TclpMasterUnlock();
- Tcl_MutexUnlock(&notifierInitMutex);
+ pthread_mutex_unlock(&notifierInitMutex);
}
-#endif
+#endif /* TCL_THREADS */
/*
*----------------------------------------------------------------------
@@ -319,23 +323,28 @@ StartNotifierThread(void)
ClientData
Tcl_InitNotifier(void)
{
- //fprintf(stderr, "==== Tcl_InitNotifier atForkInit %d notifierCount %d\n", atForkInit, notifierCount);
if (tclNotifierHooks.initNotifierProc) {
return tclNotifierHooks.initNotifierProc();
} else {
- ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
+ ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
#ifdef TCL_THREADS
tsdPtr->eventReady = 0;
+#ifndef __CYGWIN__
/*
- * Start the Notifier thread if necessary.
+ * Initialize thread specific condition variable for this thread.
*/
+ if (tsdPtr->waitCVinitialized == 0) {
+ pthread_cond_init(&tsdPtr->waitCV, NULL);
+ tsdPtr->waitCVinitialized = 1;
+ }
+#endif
- Tcl_MutexLock(&notifierMutex);
-#if defined(HAVE_PTHREAD_ATFORK) && !defined(__APPLE__) && !defined(__hpux)
+ pthread_mutex_lock(&notifierInitMutex);
+
+# if defined(HAVE_PTHREAD_ATFORK) && !defined(__APPLE__) && !defined(__hpux)
/*
- * Install pthread_atfork handlers to reinitialize the notifier in the
- * child of a fork.
+ * Register pthread_atfork handlers once per process
*/
if (!atForkInit) {
int result = pthread_atfork(AtForkPrepare, AtForkParent, AtForkChild);
@@ -346,44 +355,12 @@ Tcl_InitNotifier(void)
}
atForkInit = 1;
}
-#endif /* HAVE_PTHREAD_ATFORK */
- /*
- * Check if my process id changed, e.g. I was forked
- * In this case, restart the notifier thread and close the
- * pipe to the original notifier thread
- */
-#if LAZY_THREAD_CREATE == 0
- if (notifierCount > 0 && processIDInitialized != getpid()) {
- // fprintf(stderr, "==== reset notifierCount for %d\n", getpid());
- Tcl_ConditionFinalize(&notifierCV);
- notifierCount = 0;
- processIDInitialized = 0;
- close(triggerPipe);
- triggerPipe = -1;
- }
-#endif
- if (notifierCount == 0) {
-#if LAZY_THREAD_CREATE == 0
- if (TclpThreadCreate(&notifierThread, NotifierThreadProc, NULL,
- TCL_THREAD_STACK_DEFAULT, TCL_THREAD_JOINABLE) != TCL_OK) {
- Tcl_Panic("Tcl_InitNotifier: unable to start notifier thread");
- }
- processIDInitialized = getpid();
-#endif
- }
- notifierCount++;
+# endif /* HAVE_PTHREAD_ATFORK */
-#if LAZY_THREAD_CREATE == 0
- /*
- * Wait for the notifier pipe to be created.
- */
+ notifierCount++;
- while (triggerPipe < 0) {
- Tcl_ConditionWait(&notifierCV, &notifierMutex, NULL);
- }
-#endif
+ pthread_mutex_unlock(&notifierInitMutex);
- Tcl_MutexUnlock(&notifierMutex);
#endif /* TCL_THREADS */
return tsdPtr;
}
@@ -418,9 +395,16 @@ Tcl_FinalizeNotifier(
#ifdef TCL_THREADS
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
- Tcl_MutexLock(&notifierMutex);
+ /*
+ * Check if FinializeNotifier was called without a prior InitNotifier
+ * in this thread.
+ */
+#ifndef __CYGWIN__
+ assert(tsdPtr->waitCVinitialized == 1);
+#endif
+
+ pthread_mutex_lock(&notifierInitMutex);
notifierCount--;
- //fprintf(stderr, "==== Tcl_Tcl_FinalizeNotifier (after decr) atForkInit %d notifierCount %d\n", atForkInit, notifierCount);
/*
* If this is the last thread to use the notifier, close the notifier
@@ -428,17 +412,18 @@ Tcl_FinalizeNotifier(
*/
if (notifierCount == 0) {
-#if LAZY_THREAD_CREATE == 1
+
if (triggerPipe != -1) {
if (write(triggerPipe, "q", 1) != 1) {
Tcl_Panic("Tcl_FinalizeNotifier: %s",
"unable to write q to triggerPipe");
}
close(triggerPipe);
- triggerPipe = -1;
-
+ while(triggerPipe != -1) {
+ pthread_cond_wait(&notifierCV, &notifierMutex);
+ }
if (notifierThreadRunning) {
- int result = Tcl_JoinThread(notifierThread, NULL);
+ int result = pthread_join((pthread_t) notifierThread, NULL);
if (result) {
Tcl_Panic("Tcl_FinalizeNotifier: unable to join notifier "
@@ -447,52 +432,6 @@ Tcl_FinalizeNotifier(
notifierThreadRunning = 0;
}
}
-#else
- int result;
-
-# if AT_FORK_INIT_VALUE == 1
- if (triggerPipe != -1) {
- if (write(triggerPipe, "q", 1) != 1) {
- Tcl_Panic("Tcl_FinalizeNotifier: %s",
- "unable to write q to triggerPipe");
- }
- close(triggerPipe);
- triggerPipe = -1;
- }
-# else
-
- if (triggerPipe < 0) {
- Tcl_Panic("Tcl_FinalizeNotifier: %s",
- "notifier pipe not initialized");
- }
-
- /*
- * Send "q" message to the notifier thread so that it will
- * terminate. The notifier will return from its call to select()
- * and notice that a "q" message has arrived, it will then close
- * its side of the pipe and terminate its thread. Note the we can
- * not just close the pipe and check for EOF in the notifier thread
- * because if a background child process was created with exec,
- * select() would not register the EOF on the pipe until the child
- * processes had terminated. [Bug: 4139] [Bug: 1222872]
- */
-
- if (write(triggerPipe, "q", 1) != 1) {
- Tcl_Panic("Tcl_FinalizeNotifier: %s",
- "unable to write q to triggerPipe");
- }
- close(triggerPipe);
- while(triggerPipe >= 0) {
- Tcl_ConditionWait(&notifierCV, &notifierMutex, NULL);
- }
-
- result = Tcl_JoinThread(notifierThread, NULL);
- if (result) {
- Tcl_Panic("Tcl_FinalizeNotifier: %s",
- "unable to join notifier thread");
- }
-# endif
-#endif
}
/*
@@ -502,10 +441,11 @@ Tcl_FinalizeNotifier(
#ifdef __CYGWIN__
CloseHandle(tsdPtr->event);
#else /* __CYGWIN__ */
- Tcl_ConditionFinalize(&(tsdPtr->waitCV));
+ pthread_cond_destroy(&tsdPtr->waitCV);
#endif /* __CYGWIN__ */
- Tcl_MutexUnlock(&notifierMutex);
+ pthread_mutex_unlock(&notifierInitMutex);
+
#endif /* TCL_THREADS */
}
}
@@ -540,14 +480,16 @@ Tcl_AlertNotifier(
#ifdef TCL_THREADS
ThreadSpecificData *tsdPtr = clientData;
- Tcl_MutexLock(&notifierMutex);
+ pthread_mutex_lock(&notifierMutex);
tsdPtr->eventReady = 1;
-# ifdef __CYGWIN__
+
+# ifdef __CYGWIN__
PostMessageW(tsdPtr->hwnd, 1024, 0, 0);
-# else
- Tcl_ConditionNotify(&tsdPtr->waitCV);
-# endif /* __CYGWIN__ */
- Tcl_MutexUnlock(&notifierMutex);
+# else
+ pthread_cond_broadcast(&tsdPtr->waitCV);
+# endif /* __CYGWIN__ */
+
+ pthread_mutex_unlock(&notifierMutex);
#endif /* TCL_THREADS */
}
}
@@ -611,13 +553,9 @@ Tcl_ServiceModeHook(
if (tclNotifierHooks.serviceModeHookProc) {
tclNotifierHooks.serviceModeHookProc(mode);
return;
- } else {
-#if LAZY_THREAD_CREATE == 1
- if (mode == TCL_SERVICE_ALL) {
- StartNotifierThread();
- }
-#else
- /* Does nothing in this implementation. */
+ } else if (mode == TCL_SERVICE_ALL) {
+#if TCL_THREADS
+ StartNotifierThread();
#endif
}
}
@@ -656,6 +594,13 @@ Tcl_CreateFileHandler(
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
FileHandler *filePtr;
+ /*
+ * Check if InitNotifier was called before in this thread
+ */
+#ifndef __CYGWIN__
+ assert(tsdPtr->waitCVinitialized == 1);
+#endif
+
for (filePtr = tsdPtr->firstFileHandlerPtr; filePtr != NULL;
filePtr = filePtr->nextPtr) {
if (filePtr->fd == fd) {
@@ -728,6 +673,13 @@ Tcl_DeleteFileHandler(
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
/*
+ * Check if InitNotifier was called before in this thread
+ */
+#ifndef __CYGWIN__
+ assert(tsdPtr->waitCVinitialized == 1);
+#endif
+
+ /*
* Find the entry for the given file (and return if there isn't one).
*/
@@ -831,8 +783,15 @@ FileHandlerEventProc(
*/
tsdPtr = TCL_TSD_INIT(&dataKey);
- for (filePtr = tsdPtr->firstFileHandlerPtr; filePtr != NULL;
- filePtr = filePtr->nextPtr) {
+
+ /*
+ * Check if InitNotifier was called before in this thread
+ */
+#ifndef __CYGWIN__
+ assert(tsdPtr->waitCVinitialized == 1);
+#endif
+
+ for (filePtr = tsdPtr->firstFileHandlerPtr; filePtr != NULL; filePtr = filePtr->nextPtr) {
if (filePtr->fd != fileEvPtr->fd) {
continue;
}
@@ -930,6 +889,13 @@ Tcl_WaitForEvent(
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
/*
+ * Check if InitNotifier was called before in this thread
+ */
+#ifndef __CYGWIN__
+ assert(tsdPtr->waitCVinitialized == 1);
+#endif
+
+ /*
* Set up the timeout structure. Note that if there are no events to
* check for, we return with a negative result rather than blocking
* forever.
@@ -968,12 +934,11 @@ Tcl_WaitForEvent(
#ifdef TCL_THREADS
/*
- * Place this thread on the list of interested threads, signal the
- * notifier thread, and wait for a response or a timeout.
+ * Start notifier thread and place this thread on the list of
+ * interested threads, signal the notifier thread, and wait for a
+ * response or a timeout.
*/
-#if LAZY_THREAD_CREATE == 1
StartNotifierThread();
-#endif
#ifdef __CYGWIN__
if (!tsdPtr->hwnd) {
@@ -999,7 +964,7 @@ Tcl_WaitForEvent(
}
#endif /* __CYGWIN */
- Tcl_MutexLock(&notifierMutex);
+ pthread_mutex_lock(&notifierInitMutex);
if (timePtr != NULL && timePtr->sec == 0 && (timePtr->usec == 0
#if defined(__APPLE__) && defined(__LP64__)
@@ -1064,12 +1029,12 @@ Tcl_WaitForEvent(
} else {
timeout = 0xFFFFFFFF;
}
- Tcl_MutexUnlock(&notifierMutex);
+ pthread_mutex_unlock(&notifierMutex);
MsgWaitForMultipleObjects(1, &tsdPtr->event, 0, timeout, 1279);
- Tcl_MutexLock(&notifierMutex);
+ pthread_mutex_lock(&notifierMutex);
}
#else
- Tcl_ConditionWait(&tsdPtr->waitCV, &notifierMutex, timePtr);
+ pthread_cond_wait(&tsdPtr->waitCV, &notifierMutex);
#endif /* __CYGWIN__ */
}
tsdPtr->eventReady = 0;
@@ -1172,7 +1137,7 @@ Tcl_WaitForEvent(
filePtr->readyMask = mask;
}
#ifdef TCL_THREADS
- Tcl_MutexUnlock(&notifierMutex);
+ pthread_mutex_unlock(&notifierInitMutex);
#endif /* TCL_THREADS */
return 0;
}
@@ -1240,20 +1205,18 @@ NotifierThreadProc(
"could not make trigger pipe close-on-exec");
}
-// fprintf(stderr, "=== Starting Notifier Thread\n");
/*
* Install the write end of the pipe into the global variable.
*/
- Tcl_MutexLock(&notifierMutex);
- triggerPipe = fds[1];
-
/*
* Signal any threads that are waiting.
*/
- Tcl_ConditionNotify(&notifierCV);
- Tcl_MutexUnlock(&notifierMutex);
+ pthread_mutex_lock(&notifierMutex);
+ triggerPipe = fds[1];
+ pthread_cond_broadcast(&notifierCV);
+ pthread_mutex_unlock(&notifierMutex);
/*
* Look for file events and report them to interested threads.
@@ -1269,7 +1232,8 @@ NotifierThreadProc(
* notifiers.
*/
- Tcl_MutexLock(&notifierMutex);
+ pthread_mutex_lock(&notifierMutex);
+
timePtr = NULL;
for (tsdPtr = waitingListPtr; tsdPtr; tsdPtr = tsdPtr->nextPtr) {
for (i = tsdPtr->numFdBits-1; i >= 0; --i) {
@@ -1296,7 +1260,7 @@ NotifierThreadProc(
timePtr = &poll;
}
}
- Tcl_MutexUnlock(&notifierMutex);
+ pthread_mutex_unlock(&notifierMutex);
/*
* Set up the select mask to include the receive pipe.
@@ -1306,7 +1270,6 @@ NotifierThreadProc(
numFdBits = receivePipe + 1;
}
FD_SET(receivePipe, &readableMask);
-
if (select(numFdBits, &readableMask, &writableMask, &exceptionMask,
timePtr) == -1) {
/*
@@ -1320,7 +1283,8 @@ NotifierThreadProc(
* Alert any threads that are waiting on a ready file descriptor.
*/
- Tcl_MutexLock(&notifierMutex);
+ pthread_mutex_lock(&notifierMutex);
+
for (tsdPtr = waitingListPtr; tsdPtr; tsdPtr = tsdPtr->nextPtr) {
found = 0;
@@ -1367,18 +1331,17 @@ NotifierThreadProc(
#ifdef __CYGWIN__
PostMessageW(tsdPtr->hwnd, 1024, 0, 0);
#else
- Tcl_ConditionNotify(&tsdPtr->waitCV);
+ pthread_cond_broadcast(&tsdPtr->waitCV);
#endif /* __CYGWIN__ */
}
}
- Tcl_MutexUnlock(&notifierMutex);
+ pthread_mutex_unlock(&notifierMutex);
/*
* Consume the next byte from the notifier pipe if the pipe was
* readable. Note that there may be multiple bytes pending, but to
* avoid a race condition we only read one at a time.
*/
-
if (FD_ISSET(receivePipe, &readableMask)) {
i = read(receivePipe, buf, 1);
@@ -1401,10 +1364,11 @@ NotifierThreadProc(
fprintf(stderr, "=== Stopping Notifier Thread\n");
close(receivePipe);
- Tcl_MutexLock(&notifierMutex);
+
+ pthread_mutex_lock(&notifierMutex);
triggerPipe = -1;
- Tcl_ConditionNotify(&notifierCV);
- Tcl_MutexUnlock(&notifierMutex);
+ pthread_cond_broadcast(&notifierCV);
+ pthread_mutex_unlock(&notifierMutex);
TclpThreadExit(0);
}
@@ -1429,10 +1393,8 @@ fprintf(stderr, "=== Stopping Notifier Thread\n");
static void
AtForkPrepare(void)
{
-#if DEACTIVATE_ATFORK_MUTEX == 0
- Tcl_MutexLock(&notifierMutex);
- TclpMasterLock();
- TclpMutexLock();
+#if RESET_ATFORK_MUTEX == 0
+ pthread_mutex_lock(&notifierInitMutex);
#endif
}
@@ -1455,13 +1417,11 @@ AtForkPrepare(void)
static void
AtForkParent(void)
{
-#if DEACTIVATE_ATFORK_MUTEX == 0
- TclpMutexUnlock();
- TclpMasterUnlock();
- Tcl_MutexUnlock(&notifierMutex);
+#if RESET_ATFORK_MUTEX == 0
+ pthread_mutex_unlock(&notifierInitMutex);
#endif
- //fprintf(stderr, "==== atParent %d notifierCount %d atForkInit %d\n", atForkInit, notifierCount, atForkInit);
}
+
/*
*----------------------------------------------------------------------
@@ -1482,25 +1442,61 @@ AtForkParent(void)
static void
AtForkChild(void)
{
-#if DEACTIVATE_ATFORK_MUTEX == 0
- TclpMutexUnlock();
- TclpMasterUnlock();
- TclMutexUnlockAndFinalize(&notifierMutex);
+ if (notifierThreadRunning == 1) {
+ pthread_cond_destroy(&notifierCV);
+ }
+#if RESET_ATFORK_MUTEX == 0
+ pthread_mutex_unlock(&notifierInitMutex);
+#else
+ pthread_mutex_init(&notifierInitMutex, NULL);
+ pthread_mutex_init(&notifierMutex, NULL);
#endif
+ pthread_cond_init(&notifierCV, NULL);
-#if LAZY_THREAD_CREATE == 1
- //Tcl_MutexLock(&notifierInitMutex);
- notifierThreadRunning = 0;
- if (notifierCount > 0) {
- Tcl_ConditionFinalize(&notifierCV);
- notifierCount = 0;
- processIDInitialized = 0;
- close(triggerPipe);
- triggerPipe = -1;
- }
- //Tcl_MutexUnlock(&notifierInitMutex);
+ /*
+ * notifierThreadRunning == 1: thread is running, (there might be data in notifier lists)
+ * atForkInit == 0: InitNotifier was never called
+ * notifierCount != 0: unbalanced InitNotifier() / FinalizeNotifier calls
+ * waitingListPtr != 0: there are threads currently waiting for events.
+ */
+
+ if (atForkInit == 1) {
+
+ notifierCount = 0;
+ if (notifierThreadRunning == 1) {
+#ifndef __CYGWIN__
+ ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
+#endif
+ notifierThreadRunning = 0;
+
+ close(triggerPipe);
+ triggerPipe = -1;
+ /*
+ * The waitingListPtr might contain event info from multiple
+ * threads, which are invalid here, so setting it to NULL is not
+ * unreasonable.
+ */
+ waitingListPtr = NULL;
+
+ /*
+ * The tsdPtr from before the fork is copied as well. But since
+ * we are paranoic, we don't trust its condvar and reset it.
+ */
+#ifndef __CYGWIN__
+ assert(tsdPtr->waitCVinitialized == 1);
+ pthread_cond_destroy(&tsdPtr->waitCV);
+ pthread_cond_init(&tsdPtr->waitCV, NULL);
#endif
- // fprintf(stderr, "==== AtForkChild() notifierCount %d notifierThreadRunning %d atForkInit %d\n",notifierCount,notifierThreadRunning, atForkInit);
+ /*
+ * The list of registered event handlers at fork time is in
+ * tsdPtr->firstFileHandlerPtr;
+ */
+ }
+ }
+ assert(notifierCount == 0);
+ assert(triggerPipe == -1);
+ assert(waitingListPtr == NULL);
+
Tcl_InitNotifier();
}
#endif /* HAVE_PTHREAD_ATFORK */