[pypy-commit] pypy fast-gil: Partial revert of 40e4dd588bd7.
arigo
noreply at buildbot.pypy.org
Wed Jun 25 18:36:39 CEST 2014
Author: Armin Rigo <arigo at tunes.org>
Branch: fast-gil
Changeset: r72225:c43e39223544
Date: 2014-06-25 18:07 +0200
http://bitbucket.org/pypy/pypy/changeset/c43e39223544/
Log: Partial revert of 40e4dd588bd7.
diff --git a/rpython/translator/c/src/thread_gil.c b/rpython/translator/c/src/thread_gil.c
--- a/rpython/translator/c/src/thread_gil.c
+++ b/rpython/translator/c/src/thread_gil.c
@@ -53,6 +53,11 @@
void RPyGilAcquire(void)
{
/* Acquires the GIL.
+
+ XXX Note: this function saves and restores 'errno'. This is
+ needed for now because it may be *followed* by reading the
+ 'errno', although it's kind of bogus: it should be read before
+ calling RPyGilAcquire().
*/
long old_fastgil = lock_test_and_set(&rpy_fastgil, 1);
@@ -63,6 +68,7 @@
}
else {
/* Otherwise, another thread is busy with the GIL. */
+ int old_errno = errno;
/* Register me as one of the threads that is actively waiting
for the GIL. The number of such threads is found in
@@ -102,6 +108,8 @@
}
atomic_decrement(&rpy_waiting_threads);
mutex_unlock(&mutex_gil_stealer);
+
+ errno = old_errno;
}
assert(RPY_FASTGIL_LOCKED(rpy_fastgil));
More information about the pypy-commit
mailing list