Commit 4a221196 authored by Antoine Pitrou's avatar Antoine Pitrou

Merged revisions 76007 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

........
  r76007 | antoine.pitrou | 2009-11-01 12:58:22 +0100 (dim., 01 nov. 2009) | 3 lines

  Buffered I/O: optimize lock taking in the common non-contended case.
........
parent 5b056b10
......@@ -260,9 +260,11 @@ typedef struct {
#ifdef WITH_THREAD
#define ENTER_BUFFERED(self) \
Py_BEGIN_ALLOW_THREADS \
PyThread_acquire_lock(self->lock, 1); \
Py_END_ALLOW_THREADS
if (!PyThread_acquire_lock(self->lock, 0)) { \
Py_BEGIN_ALLOW_THREADS \
PyThread_acquire_lock(self->lock, 1); \
Py_END_ALLOW_THREADS \
}
#define LEAVE_BUFFERED(self) \
PyThread_release_lock(self->lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment