Message134104
| Author |
vstinner |
| Recipients |
db3l, gregory.p.smith, neologix, pitrou, python-dev, rnk, sable, vstinner |
| Date |
2011年04月19日.21:19:41 |
| SpamBayes Score |
2.3236968e-12 |
| Marked as misclassified |
No |
| Message-id |
<1303247977.21240.15.camel@marge> |
| In-reply-to |
<1303227723.3489.4.camel@localhost.localdomain> |
| Content |
> The path which sets "pthread_version" should be inside "#ifdef
> _POSIX_THREADS".
> Also, some comments about the doc:
> - you need a "versionadded" tag
Right, fixed.
> - "use_semaphores" should explain that these semaphores are used for
> locks; also the alternative is "use mutexes and condition variables",
> not "use mutexes"
Hum, a boolean was not a good idea. I replaced this key by:
* 'lock' (string): name of the lock implementation
* 'semaphore': a lock uses a semaphore
* 'mutex+cond': a lock uses a mutex and a condition variable
I also renamed 'name' key to 'thread', so 'thread' is the name of the
*thread* implementation, and 'lock' is the name of the *lock*
implementation.
For example, test_threadsignals now uses:
-----------
USING_PTHREAD_COND = (info['thread'] == 'pthread'
and info['lock'] == 'mutex+cond')
...
@unittest.skipIf(USING_PTHREAD_COND,
'POSIX condition variables cannot be interrupted')
-----------
I think that the test is more clear than:
-----------
@unittest.skipIf(info['name'] == 'pthread' and not
info['use_semaphores'],
'POSIX mutexes cannot be interrupted')
-----------
(the message was wrong, the interrupt issue is on the condition, not on
the mutex)
> - you should not document unsupported platform names ("lwp", etc.); they
> are already disabled (#error)
Oh, I didn't realize that they were already unsupported as a compilation
error. Ok, fixed. I also removed "wince": I realized that thread_wince.h
is not used (see #11863).
The new patch (version 3) marks also PyThread_Info() as private (rename
it to _PyThread_Info). |
|