A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2012-January/116051.html below:

[Python-Dev] threading.Semaphore()'s counter can become negative for non-ints

[Python-Dev] threading.Semaphore()'s counter can become negative for non-ints [Python-Dev] threading.Semaphore()'s counter can become negative for non-intsT.B. bauertomer at gmail.com
Tue Jan 31 22:58:40 CET 2012
> I concur. This is very much a non-problem.
> There is no need to add more code and slow
> running time with superfluous type checks.
>
>
> Raymond
>

What do you think about the following check from threading.py:

@@ -317,8 +317,6 @@
          self._value = value

      def acquire(self, blocking=True, timeout=None):
-        if not blocking and timeout is not None:
-            raise ValueError("can't specify timeout for non-blocking 
acquire")
          rc = False
(There are similar checks in Modules/_threadmodule.c)

Removing the check means that we ignore the timeout argument when 
blocking=False. Currently in the multiprocessing docs there is an 
outdated note concerning acquire() methods that also says: "If block is 
False then timeout is ignored". This makes the acquire() methods of the 
threading and multiprocessing modules have different behaviors.
Related: http://bugs.python.org/issue850728#msg103227

TB
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4