Tcl package Thread source code

Check-in [52f62714d9]
Login

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

Overview
Comment:For the thread pool, after adding a job completion to the hash table, be sure to signal the waiter.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 52f62714d96ed3a9303b895c7a3f1938a00af224
User & Date: mistachkin 2016-11-20 01:16:37
Context
2017-05-04
14:51
Update to latest TEA version check-in: 689f4d8368 user: jan.nijtmans tags: trunk
2016-11-20
01:16
For the thread pool, after adding a job completion to the hash table, be sure to signal the waiter. check-in: 52f62714d9 user: mistachkin tags: trunk
00:31
Move a call to ckfree() in tpool. check-in: 3064c13d57 user: mistachkin tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/threadPoolCmd.c.

1239
1240
1241
1242
1243
1244
1245

1246
1247
1248
1249
1250
1251
1252
        ckfree(rPtr->script);
        Tcl_MutexLock(&tpoolPtr->mutex);
        if (!rPtr->detached) {
            int new;
            Tcl_SetHashValue(Tcl_CreateHashEntry(&tpoolPtr->jobsDone,
                                                 (void *)(size_t)rPtr->jobId, &new),
                             (ClientData)rPtr);

        } else {
            ckfree((char*)rPtr);
        }
    }

    /*
     * Tear down the worker







>







1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
        ckfree(rPtr->script);
        Tcl_MutexLock(&tpoolPtr->mutex);
        if (!rPtr->detached) {
            int new;
            Tcl_SetHashValue(Tcl_CreateHashEntry(&tpoolPtr->jobsDone,
                                                 (void *)(size_t)rPtr->jobId, &new),
                             (ClientData)rPtr);
            SignalWaiter(tpoolPtr);
        } else {
            ckfree((char*)rPtr);
        }
    }

    /*
     * Tear down the worker