We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4b25029 commit 378e86aCopy full SHA for 378e86a
1 file changed
quaddtype/numpy_quaddtype/src/scalar.c
@@ -215,6 +215,9 @@ QuadPrecision_repr(QuadPrecisionObject *self)
215
static PyObject *
216
QuadPrecision_repr_dragon4(QuadPrecisionObject *self)
217
{
218
+#ifdef Py_GIL_DISABLED
219
+ PyMutex_Lock(&scalar_mutex);
220
+#endif
221
Dragon4_Options opt = {.scientific = 1,
222
.digit_mode = DigitMode_Unique,
223
.cutoff_mode = CutoffMode_TotalLength,
@@ -244,6 +247,9 @@ QuadPrecision_repr_dragon4(QuadPrecisionObject *self)
244
247
const char *backend_str = (self->backend == BACKEND_SLEEF) ? "sleef" : "longdouble";
245
248
PyObject *res = PyUnicode_FromFormat("QuadPrecision('%S', backend='%s')", str, backend_str);
246
249
Py_DECREF(str);
250
251
+ PyMutex_Unlock(&scalar_mutex);
252
253
return res;
254
}
255
0 commit comments