Mercurial > hg
comparison mercurial/cext/mpatch.c @ 36361:a2d11d23bb25
patches: release the GIL while applying the patch
This will allow multiple threads to apply patches at the same time.
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Mon, 05 Feb 2018 15:03:51 +0100 |
parents | 69080ee1fb0e |
children | 186c6df3a373 |
comparison
equal
deleted
inserted
replaced
36360:c25290b98190 | 36361:a2d11d23bb25 |
---|---|
107 if (!result) { | 107 if (!result) { |
108 result = NULL; | 108 result = NULL; |
109 goto cleanup; | 109 goto cleanup; |
110 } | 110 } |
111 out = PyBytes_AsString(result); | 111 out = PyBytes_AsString(result); |
112 r = mpatch_apply(out, in, inlen, patch); | 112 /* clang-format off */ |
113 { | |
114 Py_BEGIN_ALLOW_THREADS | |
115 r = mpatch_apply(out, in, inlen, patch); | |
116 Py_END_ALLOW_THREADS | |
117 } | |
118 /* clang-format on */ | |
113 if (r < 0) { | 119 if (r < 0) { |
114 Py_DECREF(result); | 120 Py_DECREF(result); |
115 result = NULL; | 121 result = NULL; |
116 } | 122 } |
117 cleanup: | 123 cleanup: |