Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch rfe-notifier-fork Excluding Merge-Ins
This is equivalent to a diff from f7fe2446ce to 92136fde90
2013-08-01
| ||
12:38 | Tcl_InitNotifier: Bug [a0bc856dcd]. Start notifier thread again if we were forked, to solve Rivet b... check-in: 02909e227f user: jan.nijtmans tags: core-8-5-branch | |
2013-07-26
| ||
13:21 | [6585b21ca8] [regexp {(\w).*?\1} abb] failed to match. Thanks to Tom Lane for passing on the discove... check-in: 2425a69341 user: dgp tags: core-8-5-branch | |
09:20 | Move test for pthread_atfork inside SC_ENABLE_THREADS check-in: efa7ddd3b9 user: jan.nijtmans tags: trunk | |
2013-07-25
| ||
17:20 | Fixed test case variable clash with 'folder' Closed-Leaf check-in: 92136fde90 user: oehhar tags: rfe-notifier-fork | |
14:25 | rebase check-in: 8cf516f508 user: jan.nijtmans tags: rfe-notifier-fork | |
14:24 | Move test for pthread_atfork inside SC_ENABLE_THREADS check-in: f7fe2446ce user: jan.nijtmans tags: core-8-5-branch | |
2013-07-24
| ||
16:51 | Demonstrate and fix memory leak in Tcl_ParseVar(). check-in: 5cc898d566 user: dgp tags: core-8-5-branch | |
Changes to ChangeLog.
|
Added tests/unixForkEvent.test.
|
Changes to unix/tclUnixNotfy.c.
︙ | |||
108 109 110 111 112 113 114 | 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 | - + + + + + + + + + + | Tcl_Condition waitCV; /* Any other thread alerts a notifier that an * event is ready to be processed by signaling * this condition variable. */ #endif /* __CYGWIN__ */ int eventReady; /* True if an event is ready to be processed. * Used as condition flag together with waitCV * above. */ |
︙ | |||
181 182 183 184 185 186 187 | 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 | - + + + + + + + - + | /* * This is the thread ID of the notifier thread that does select. */ static Tcl_ThreadId notifierThread; |
︙ | |||
263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 | 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 | + + + + + + + + + + + + + + + + + + + + + + + + + + + - + | tsdPtr->eventReady = 0; /* * Start the Notifier thread if necessary. */ Tcl_MutexLock(¬ifierMutex); #ifdef HAVE_PTHREAD_ATFORK /* * Install pthread_atfork handlers to reinitialize the notifier in the * child of a fork. */ if (!atForkInit) { int result = pthread_atfork(AtForkPrepare, AtForkParent, AtForkChild); if (result) { Tcl_Panic("Tcl_InitNotifier: pthread_atfork failed"); } atForkInit = 1; } #endif /* * 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 (notifierCount > 0 && processIDInitialized != getpid()) { notifierCount = 0; processIDInitialized = 0; close(triggerPipe); triggerPipe = -1; } if (notifierCount == 0) { if (TclpThreadCreate(¬ifierThread, NotifierThreadProc, NULL, TCL_THREAD_STACK_DEFAULT, TCL_THREAD_JOINABLE) != TCL_OK) { Tcl_Panic("Tcl_InitNotifier: unable to start notifier thread"); } processIDInitialized = getpid(); } notifierCount++; /* * Wait for the notifier pipe to be created. */ while (triggerPipe < 0) { Tcl_ConditionWait(¬ifierCV, ¬ifierMutex, NULL); } Tcl_MutexUnlock(¬ifierMutex); |
︙ | |||
1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 | 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | Tcl_MutexLock(¬ifierMutex); triggerPipe = -1; Tcl_ConditionNotify(¬ifierCV); Tcl_MutexUnlock(¬ifierMutex); TclpThreadExit (0); } #ifdef HAVE_PTHREAD_ATFORK /* *---------------------------------------------------------------------- * * AtForkPrepare -- * * Lock the notifier in preparation for a fork. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ static void AtForkPrepare(void) { } /* *---------------------------------------------------------------------- * * AtForkParent -- * * Unlock the notifier in the parent after a fork. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ static void AtForkParent(void) { } /* *---------------------------------------------------------------------- * * AtForkChild -- * * Unlock and reinstall the notifier in the child after a fork. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ static void AtForkChild(void) { notifierMutex = NULL; notifierCV = NULL; Tcl_InitNotifier(); } #endif /* HAVE_PTHREAD_ATFORK */ #endif /* TCL_THREADS */ #endif /* HAVE_COREFOUNDATION */ /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ |