diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2017-07-12 08:49:57 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2017-07-12 08:50:00 +0900 |
commit | 2d8c9073fa23a0fde76a3b8ecf8cb518d162d101 (patch) | |
tree | 6afa9ab6523da373b12545476235149f9fb709bb /gi/_gobject/gobjectmodule.c | |
parent | 834a4dcd043de07e4b8670c47ff647f58da5f5e4 (diff) | |
download | pygobject2-2d8c9073fa23a0fde76a3b8ecf8cb518d162d101.tar.gz pygobject2-2d8c9073fa23a0fde76a3b8ecf8cb518d162d101.tar.bz2 pygobject2-2d8c9073fa23a0fde76a3b8ecf8cb518d162d101.zip |
Imported Upstream version 3.9.2
Change-Id: Ie80410930b36515756001676d161cf070c996619
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'gi/_gobject/gobjectmodule.c')
-rw-r--r-- | gi/_gobject/gobjectmodule.c | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/gi/_gobject/gobjectmodule.c b/gi/_gobject/gobjectmodule.c index 3de839d..1e1cbd8 100644 --- a/gi/_gobject/gobjectmodule.c +++ b/gi/_gobject/gobjectmodule.c @@ -48,24 +48,17 @@ static void pyg_flags_add_constants(PyObject *module, GType flags_type, /** * pyg_set_thread_block_funcs: - * @block_threads_func: a function to block Python threads. - * @unblock_threads_func: a function to unblock Python threads. - * - * an interface to allow pygtk to add hooks to handle threading - * similar to the old PyGTK 0.6.x releases. May not work quite right - * anymore. + * Deprecated, only available for ABI compatibility. */ static void -pyg_set_thread_block_funcs (PyGThreadBlockFunc block_threads_func, - PyGThreadBlockFunc unblock_threads_func) +_pyg_set_thread_block_funcs (PyGThreadBlockFunc block_threads_func, + PyGThreadBlockFunc unblock_threads_func) { - g_return_if_fail(pygobject_api_functions.block_threads == NULL && - pygobject_api_functions.unblock_threads == NULL); - - pygobject_api_functions.block_threads = block_threads_func; - pygobject_api_functions.unblock_threads = unblock_threads_func; - pyglib_set_thread_block_funcs(block_threads_func, - unblock_threads_func); + PyGILState_STATE state = pyglib_gil_state_ensure (); + PyErr_Warn (PyExc_DeprecationWarning, + "Using pyg_set_thread_block_funcs is not longer needed. " + "PyGObject always uses Py_BLOCK/UNBLOCK_THREADS."); + pyglib_gil_state_release (state); } /** @@ -2031,7 +2024,7 @@ struct _PyGObject_Functions pygobject_api_functions = { pyg_error_check, - pyg_set_thread_block_funcs, + _pyg_set_thread_block_funcs, (PyGThreadBlockFunc)0, /* block_threads */ (PyGThreadBlockFunc)0, /* unblock_threads */ |