Differences From Artifact [f0274e7e9d]:
- File unix/tclUnixThrd.c — part of check-in [51f6c167f6] at 2000-04-09 16:04:16 on branch trunk — 2000-04-08 Andreas Kupries <a.kupries@westend.com> * Overall change: Definition of a public API for the creation of new threads. * generic/tclInt.h (line 1802f): Removed the definition of 'TclpThreadCreate'. (line 793f) Removed the definition of 'Tcl_ThreadCreateProc'. * generic/tcl.h (line 388f): Readded the definition of 'Tcl_ThreadCreateProc'. Added Win32 stuff send in by David Graveraux <davygrvy@bigfoot.com> to that too (__stdcall, ...). Added macros for the default stacksize and allowed flags. * generic/tcl.decls (line 1356f): Added definition of 'Tcl_CreateThread', slot 393 of the stub table. Two new arguments in the public API, for stacksize and flags. * win/tclWinThrd.c: * mac/tclMacThrd.c: Renamed TclpThreadCreate to Tcl_CreateThread, added handling of the stacksize. Flags are currently ignored. * unix/tclUnixThrd.c: See above, but handles joinable flag. Ignores the specified stacksize if the macro HAVE_PTHREAD_ATTR_SETSTACKSIZE is not defined. * generic/tclThreadTest.c (line 363): See below. * unix/tclUnixNotfy.c (line 210): Adapted to the changes above. Uses default stacksize and no flags now. * unic/tcl.m4 (line 382f): Added a check for 'pthread_attr_setstacksize' to detect platforms not implementing this feature of pthreads. If it is implemented, configure will define the macro HAVE_PTHREAD_ATTR_SETSTACKSIZE (See unix/tclUnixThrd.c too). * doc/Thread.3: Added Tcl_CreateThread and its arguments to the list of described functions. Removed stuff about not providing a public C-API for thread-creation. (user: kupries size: 17161)
To Artifact [02528bfdb1]:
- File unix/tclUnixThrd.c — part of check-in [26ed7e69c3] at 2000-04-09 21:14:22 on branch trunk — * unix/tclUnixThrd.c (Tcl_CreateThread): moved TCL_THREADS ifdef inside of func as it is declared for non-threads builds as well. In the non-threads case, it always returns TCL_ERROR (couldn't create thread). (user: hobbs size: 17233)
| ︙ | |||
50 51 52 53 54 55 56 | 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | - | #define MASTER_LOCK pthread_mutex_lock(&masterLock) #define MASTER_UNLOCK pthread_mutex_unlock(&masterLock) #endif /* TCL_THREADS */ |
| ︙ | |||
78 79 80 81 82 83 84 85 86 87 88 89 90 91 | 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | + |
Tcl_ThreadId *idPtr; /* Return, the ID of the thread */
Tcl_ThreadCreateProc proc; /* Main() function of the thread */
ClientData clientData; /* The one argument to Main() */
int stackSize; /* Size of stack for the new thread */
int flags; /* Flags controlling behaviour of
* the new thread */
{
#ifdef TCL_THREADS
pthread_attr_t attr;
int result;
pthread_attr_init(&attr);
pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM);
#ifdef HAVE_PTHREAD_ATTR_SETSTACKSIZE
|
| ︙ | |||
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | + + + + |
(void * (*)())proc, (void *)clientData)) {
result = TCL_ERROR;
} else {
result = TCL_OK;
}
pthread_attr_destroy(&attr);
return result;
#else
return TCL_ERROR;
#endif /* TCL_THREADS */
}
#ifdef TCL_THREADS
/*
*----------------------------------------------------------------------
*
* TclpThreadExit --
*
* This procedure terminates the current thread.
*
|
| ︙ |