We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a7f6b30 commit d6daf79Copy full SHA for d6daf79
1 file changed
src/asyncproxy.c
@@ -277,12 +277,15 @@ asyncproxy_run(void *args)
277
eidx = i;
278
goto out;
279
}
280
- if (ap->transform[i] != NULL) {
+ pthread_mutex_lock(&ap->mutex);
281
+ void (*transform)(void *, int) = ap->transform[i];
282
+ pthread_mutex_unlock(&ap->mutex);
283
+ if (transform != NULL) {
284
#if defined(PYTHON_AWARE)
285
PyGILState_STATE gstate;
286
gstate = PyGILState_Ensure();
287
#endif
- ap->transform[i](BUF_P(&bufs[i]), r.len);
288
+ transform(BUF_P(&bufs[i]), r.len);
289
290
PyGILState_Release(gstate);
291
0 commit comments