diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2018-09-28 18:57:25 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2018-09-28 18:57:25 (GMT) |
| commit | d2edfcf2bd90298d02756daff2a473a3eebcd2ee (patch) | |
| tree | 2cbba2917cd81a2d7a627fcff480ae2c6ae25adf /doc/Thread.3 | |
| parent | b4ae859604d0075ae30c40a35126efb600e3abc9 (diff) | |
| parent | 3f2c2080ccdce8f6f42a62651cc0e53cb2d8dba9 (diff) | |
| download | tcl-d2edfcf2bd90298d02756daff2a473a3eebcd2ee.zip tcl-d2edfcf2bd90298d02756daff2a473a3eebcd2ee.tar.gz tcl-d2edfcf2bd90298d02756daff2a473a3eebcd2ee.tar.bz2 | |
Merge 8.7
Diffstat (limited to 'doc/Thread.3')
| -rw-r--r-- | doc/Thread.3 | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/doc/Thread.3 b/doc/Thread.3 index 5966a71..2005c93 100644 --- a/doc/Thread.3 +++ b/doc/Thread.3 @@ -45,7 +45,9 @@ int .AP Tcl_Condition *condPtr in A condition variable, which must be associated with a mutex lock. .AP Tcl_Mutex *mutexPtr in -A mutex lock. +.VS TIP509 +A recursive mutex lock. +.VE TIP509 .AP "const Tcl_Time" *timePtr in A time limit on the condition wait. NULL to wait forever. Note that a polling value of 0 seconds does not make much sense. @@ -140,8 +142,12 @@ of code by calling \fBTcl_MutexLock\fR and \fBTcl_MutexUnlock\fR. If one thread holds a mutex, any other thread calling \fBTcl_MutexLock\fR will block until \fBTcl_MutexUnlock\fR is called. A mutex can be destroyed after its use by calling \fBTcl_MutexFinalize\fR. -The result of locking a mutex twice from the same thread is undefined. -On some platforms it will result in a deadlock. +.VS TIP509 +Mutexes are reentrant: they can be locked several times from the same +thread. However there must be exactly one call to +\fBTcl_MutexUnlock\fR for each call to \fBTcl_MutexLock\fR in order +for a thread to release a mutex completely. +.VE TIP509 The \fBTcl_MutexLock\fR, \fBTcl_MutexUnlock\fR and \fBTcl_MutexFinalize\fR procedures are defined as empty macros if not compiling with threads enabled. For declaration of mutexes the \fBTCL_DECLARE_MUTEX\fR macro should be used. |
