[gimp/gimp-2-10] libgimpbase: remove the gimp protocol mutex and gp_lock()/gp_unlock()
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gimp-2-10] libgimpbase: remove the gimp protocol mutex and gp_lock()/gp_unlock()
- Date: Sun, 4 Aug 2019 20:49:50 +0000 (UTC)
commit 176219020af8e197b41b4c960a375efb93e33852
Author: Michael Natterer <mitch gimp org>
Date: Sun Aug 4 22:49:25 2019 +0200
libgimpbase: remove the gimp protocol mutex and gp_lock()/gp_unlock()
The protocol is supposed to be used recursively, the locks just
deadlock in some situations. Threaded use of the wire protocol is
simply forbidden.
libgimp/gimp.c | 2 --
libgimp/gimptile.c | 5 +----
libgimpbase/gimpbase.def | 2 --
libgimpbase/gimpprotocol.c | 15 +--------------
libgimpbase/gimpprotocol.h | 3 ---
5 files changed, 2 insertions(+), 25 deletions(-)
---
diff --git a/libgimp/gimp.c b/libgimp/gimp.c
index df9b7f3dfa..9a78e3733a 100644
--- a/libgimp/gimp.c
+++ b/libgimp/gimp.c
@@ -1178,12 +1178,10 @@ gimp_run_procedure2 (const gchar *name,
proc_run.nparams = n_params;
proc_run.params = (GPParam *) params;
- gp_lock ();
if (! gp_proc_run_write (_writechannel, &proc_run, NULL))
gimp_quit ();
gimp_read_expect_msg (&msg, GP_PROC_RETURN);
- gp_unlock ();
proc_return = msg.data;
diff --git a/libgimp/gimptile.c b/libgimp/gimptile.c
index 99a041a4eb..4570ebbd67 100644
--- a/libgimp/gimptile.c
+++ b/libgimp/gimptile.c
@@ -222,7 +222,6 @@ gimp_tile_get (GimpTile *tile)
tile_req.tile_num = tile->tile_num;
tile_req.shadow = tile->shadow;
- gp_lock ();
if (! gp_tile_req_write (_writechannel, &tile_req, NULL))
gimp_quit ();
@@ -253,7 +252,6 @@ gimp_tile_get (GimpTile *tile)
if (! gp_tile_ack_write (_writechannel, NULL))
gimp_quit ();
- gp_unlock ();
gimp_wire_destroy (&msg);
}
@@ -272,7 +270,6 @@ gimp_tile_put (GimpTile *tile)
tile_req.tile_num = 0;
tile_req.shadow = 0;
- gp_lock ();
if (! gp_tile_req_write (_writechannel, &tile_req, NULL))
gimp_quit ();
@@ -305,7 +302,7 @@ gimp_tile_put (GimpTile *tile)
gimp_wire_destroy (&msg);
gimp_read_expect_msg (&msg, GP_TILE_ACK);
- gp_unlock ();
+
gimp_wire_destroy (&msg);
}
diff --git a/libgimpbase/gimpbase.def b/libgimpbase/gimpbase.def
index 55fffdc65b..2efc1dee76 100644
--- a/libgimpbase/gimpbase.def
+++ b/libgimpbase/gimpbase.def
@@ -231,7 +231,6 @@ EXPORTS
gp_extension_ack_write
gp_has_init_write
gp_init
- gp_lock
gp_params_destroy
gp_proc_install_write
gp_proc_return_write
@@ -243,4 +242,3 @@ EXPORTS
gp_tile_ack_write
gp_tile_data_write
gp_tile_req_write
- gp_unlock
diff --git a/libgimpbase/gimpprotocol.c b/libgimpbase/gimpprotocol.c
index ffb9194f17..4ebaa9c637 100644
--- a/libgimpbase/gimpprotocol.c
+++ b/libgimpbase/gimpprotocol.c
@@ -26,7 +26,6 @@
#include "gimpprotocol.h"
#include "gimpwire.h"
-static GMutex readwrite_mutex;
static void _gp_quit_read (GIOChannel *channel,
GimpWireMessage *msg,
@@ -1897,18 +1896,6 @@ gp_params_destroy (GPParam *params,
g_free (params);
}
-void
-gp_lock (void)
-{
- g_mutex_lock (&readwrite_mutex);
-}
-
-void
-gp_unlock (void)
-{
- g_mutex_unlock (&readwrite_mutex);
-}
-
/* has_init */
static void
@@ -1920,7 +1907,7 @@ _gp_has_init_read (GIOChannel *channel,
static void
_gp_has_init_write (GIOChannel *channel,
- GimpWireMessage *msg,
+ GimpWireMessage *msg,
gpointer user_data)
{
}
diff --git a/libgimpbase/gimpprotocol.h b/libgimpbase/gimpprotocol.h
index 0481b85e4d..3c7dc44d3e 100644
--- a/libgimpbase/gimpprotocol.h
+++ b/libgimpbase/gimpprotocol.h
@@ -236,9 +236,6 @@ gboolean gp_has_init_write (GIOChannel *channel,
void gp_params_destroy (GPParam *params,
gint nparams);
-void gp_lock (void);
-void gp_unlock (void);
-
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]