[pypy-commit] pypy fast-gil: Don't need the errno-saving logic
arigo
noreply at buildbot.pypy.org
Wed Jun 25 11:14:10 CEST 2014
Author: Armin Rigo <arigo at tunes.org>
Branch: fast-gil
Changeset: r72208:40e4dd588bd7
Date: 2014-06-25 11:13 +0200
http://bitbucket.org/pypy/pypy/changeset/40e4dd588bd7/
Log: Don't need the errno-saving logic
diff --git a/pypy/module/thread/gil.py b/pypy/module/thread/gil.py
--- a/pypy/module/thread/gil.py
+++ b/pypy/module/thread/gil.py
@@ -70,9 +70,7 @@
def before_external_call():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
- e = get_errno()
rgil.gil_release()
- set_errno(e)
before_external_call._gctransformer_hint_cannot_collect_ = True
before_external_call._dont_reach_me_in_del_ = True
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
@@ -56,7 +56,7 @@
void RPyGilAcquire(void)
{
- /* Acquires the GIL. Note: this function saves and restores 'errno'.
+ /* Acquires the GIL.
*/
long old_fastgil = lock_test_and_set(&rpy_fastgil, 1);
@@ -67,7 +67,6 @@
}
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
@@ -107,8 +106,6 @@
}
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