Tcl Source Code

Check-in [0107005970]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Mark unixforkevent-1.1 nonPortable, until proven on more platforms.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-5-branch
Files: files | file ages | folders
SHA1: 0107005970cef5f67411393311ca2986741dbf2f
User & Date: jan.nijtmans 2013-08-05 21:58:21
Context
2013-08-11
14:41
Never guess non-existing timezone name "America/Brasilia" on Windows. Reported by Arnulf Wiedemann check-in: f04e2881d3 user: jan.nijtmans tags: core-8-5-branch
2013-08-05
22:00
Mark unixforkevent-1.1 nonPortable, until proven on more platforms. Make sure that when testing for... check-in: 4e3f024bd7 user: jan.nijtmans tags: trunk
21:58
Mark unixforkevent-1.1 nonPortable, until proven on more platforms. check-in: 0107005970 user: jan.nijtmans tags: core-8-5-branch
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
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to tests/unixForkEvent.test.

12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
namespace import -force ::tcltest::*

testConstraint testfork [llength [info commands testfork]]

# Test if the notifier thread is well initialized in a forked interpreter
# by Tcl_InitNotifier
test unixforkevent-1.1 {fork and test writeable event} \
    -constraints testfork \
    -body {
	set myFolder [makeDirectory unixtestfork]
	set pid [testfork]
	if {$pid == 0} {
	    # we are the forked process
	    set result initialized
	    set h [open [file join $myFolder test.txt] w]







|







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
namespace import -force ::tcltest::*

testConstraint testfork [llength [info commands testfork]]

# Test if the notifier thread is well initialized in a forked interpreter
# by Tcl_InitNotifier
test unixforkevent-1.1 {fork and test writeable event} \
    -constraints {testfork nonPortable} \
    -body {
	set myFolder [makeDirectory unixtestfork]
	set pid [testfork]
	if {$pid == 0} {
	    # we are the forked process
	    set result initialized
	    set h [open [file join $myFolder test.txt] w]

Changes to unix/tclUnixTest.c.

570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
    }
    pid = fork();
    if (pid == -1) {
        Tcl_AppendResult(interp,
                "Cannot fork", NULL);
        return TCL_ERROR;
    }
#ifndef HAVE_PTHREAD_ATFORK
    /* Only needed when pthread_atfork is not present. */
    if (pid==0) {
	Tcl_InitNotifier();
    }
#endif
    Tcl_SetObjResult(interp, Tcl_NewIntObj(pid));
    return TCL_OK;
}







|
|







570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
    }
    pid = fork();
    if (pid == -1) {
        Tcl_AppendResult(interp,
                "Cannot fork", NULL);
        return TCL_ERROR;
    }
#if !defined(HAVE_PTHREAD_ATFORK) || defined(MAC_OSX_TCL)
    /* Only needed when pthread_atfork is not present or on OSX. */
    if (pid==0) {
	Tcl_InitNotifier();
    }
#endif
    Tcl_SetObjResult(interp, Tcl_NewIntObj(pid));
    return TCL_OK;
}