diff options
author | Jerome Soumagne <jsoumagne@hdfgroup.org> | 2014-06-19 20:48:47 (GMT) |
---|---|---|
committer | Jerome Soumagne <jsoumagne@hdfgroup.org> | 2014-06-19 20:48:47 (GMT) |
commit | 085bfe0775c4ad3b8b9e2fb4bcf2a446b93a0204 (patch) | |
tree | bcdc6ea3c40c8ebe77674bf2394ece0314136fe2 /src | |
parent | aa13416ade6f4cf3755f1c5440f84299ddc24396 (diff) | |
download | hdf5-085bfe0775c4ad3b8b9e2fb4bcf2a446b93a0204.zip hdf5-085bfe0775c4ad3b8b9e2fb4bcf2a446b93a0204.tar.gz hdf5-085bfe0775c4ad3b8b9e2fb4bcf2a446b93a0204.tar.bz2 |
[svn-r25334] Add Py_BEGIN_ALLOW_THREADS/Py_END_ALLOW_THREADS
Diffstat (limited to 'src')
-rw-r--r-- | src/H5VLiod_analysis.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/H5VLiod_analysis.c b/src/H5VLiod_analysis.c index 24c4ae4..b230950 100644 --- a/src/H5VLiod_analysis.c +++ b/src/H5VLiod_analysis.c @@ -566,10 +566,11 @@ H5VL__iod_split(const char *split_script, void *data, size_t num_elmts, hid_t *split_data_type_id) { herr_t ret_value = SUCCEED; /* Return value */ - PyObject *po_func = NULL, *po_numpy_array = NULL, *po_args_tup = NULL; PyObject *po_numpy_array_split = NULL; + Py_BEGIN_ALLOW_THREADS + pthread_mutex_lock(&h5python_mutex); if(!numpy_initialized) { H5VL__iod_numpy_init(); @@ -608,7 +609,7 @@ done: Py_XDECREF(po_args_tup); Py_XDECREF(po_numpy_array); Py_XDECREF(po_numpy_array_split); - + Py_END_ALLOW_THREADS return ret_value; } /* end H5VL__iod_split() */ @@ -634,6 +635,8 @@ H5VL__iod_combine(const char *combine_script, void **split_data, size_t *split_n size_t count = 0; size_t i, k = 0; + Py_BEGIN_ALLOW_THREADS + pthread_mutex_lock(&h5python_mutex); if(!numpy_initialized) { H5VL__iod_numpy_init(); @@ -696,7 +699,7 @@ done: Py_XDECREF(po_numpy_arrays + i); } Py_XDECREF(po_numpy_array_combine); - + Py_END_ALLOW_THREADS return ret_value; } @@ -722,6 +725,8 @@ H5VL__iod_integrate(const char *integrate_script, void **combine_data, PyObject *po_numpy_array_integrate = NULL; size_t i, k = 0; + Py_BEGIN_ALLOW_THREADS + pthread_mutex_lock(&h5python_mutex); if(!numpy_initialized) { H5VL__iod_numpy_init(); @@ -784,7 +789,7 @@ done: Py_XDECREF(po_numpy_arrays + i); } Py_XDECREF(po_numpy_array_integrate); - + Py_END_ALLOW_THREADS return ret_value; } |