mirror of https://github.com/GNOME/gimp.git
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.
This commit is contained in:
parent
5ac8b70e47
commit
888c42fbb8
|
@ -806,7 +806,6 @@ gimp_run_procedure_with_array (const gchar *name,
|
|||
proc_run.nparams = gimp_value_array_length (arguments);
|
||||
proc_run.params = _gimp_value_array_to_gp_params (arguments, FALSE);
|
||||
|
||||
gp_lock ();
|
||||
if (! gp_proc_run_write (_gimp_writechannel, &proc_run, NULL))
|
||||
gimp_quit ();
|
||||
|
||||
|
@ -814,7 +813,6 @@ gimp_run_procedure_with_array (const gchar *name,
|
|||
_gimp_plug_in_read_expect_msg (PLUG_IN, &msg, GP_PROC_RETURN);
|
||||
else
|
||||
_gimp_read_expect_msg (&msg, GP_PROC_RETURN);
|
||||
gp_unlock ();
|
||||
|
||||
proc_return = msg.data;
|
||||
|
||||
|
|
|
@ -334,7 +334,6 @@ gimp_tile_get (GimpTileBackendPlugin *backend_plugin,
|
|||
tile_req.tile_num = tile->tile_num;
|
||||
tile_req.shadow = priv->shadow;
|
||||
|
||||
gp_lock ();
|
||||
if (! gp_tile_req_write (_gimp_writechannel, &tile_req, NULL))
|
||||
gimp_quit ();
|
||||
|
||||
|
@ -384,7 +383,6 @@ gimp_tile_get (GimpTileBackendPlugin *backend_plugin,
|
|||
|
||||
if (! gp_tile_ack_write (_gimp_writechannel, NULL))
|
||||
gimp_quit ();
|
||||
gp_unlock ();
|
||||
|
||||
gimp_wire_destroy (&msg);
|
||||
}
|
||||
|
@ -404,7 +402,6 @@ gimp_tile_put (GimpTileBackendPlugin *backend_plugin,
|
|||
tile_req.tile_num = 0;
|
||||
tile_req.shadow = 0;
|
||||
|
||||
gp_lock ();
|
||||
if (! gp_tile_req_write (_gimp_writechannel, &tile_req, NULL))
|
||||
gimp_quit ();
|
||||
|
||||
|
@ -447,7 +444,6 @@ gimp_tile_put (GimpTileBackendPlugin *backend_plugin,
|
|||
_gimp_plug_in_read_expect_msg (plug_in, &msg, GP_TILE_ACK);
|
||||
else
|
||||
_gimp_read_expect_msg (&msg, GP_TILE_ACK);
|
||||
gp_unlock ();
|
||||
|
||||
gimp_wire_destroy (&msg);
|
||||
}
|
||||
|
|
|
@ -279,7 +279,6 @@ EXPORTS
|
|||
gp_extension_ack_write
|
||||
gp_has_init_write
|
||||
gp_init
|
||||
gp_lock
|
||||
gp_proc_install_write
|
||||
gp_proc_return_write
|
||||
gp_proc_run_write
|
||||
|
@ -290,4 +289,3 @@ EXPORTS
|
|||
gp_tile_ack_write
|
||||
gp_tile_data_write
|
||||
gp_tile_req_write
|
||||
gp_unlock
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
#include "gimpprotocol.h"
|
||||
#include "gimpwire.h"
|
||||
|
||||
static GMutex readwrite_mutex;
|
||||
|
||||
static void _gp_quit_read (GIOChannel *channel,
|
||||
GimpWireMessage *msg,
|
||||
|
@ -204,20 +203,6 @@ gp_init (void)
|
|||
_gp_has_init_destroy);
|
||||
}
|
||||
|
||||
/* lock/unlock the global wire mutex */
|
||||
|
||||
void
|
||||
gp_lock (void)
|
||||
{
|
||||
g_mutex_lock (&readwrite_mutex);
|
||||
}
|
||||
|
||||
void
|
||||
gp_unlock (void)
|
||||
{
|
||||
g_mutex_unlock (&readwrite_mutex);
|
||||
}
|
||||
|
||||
/* public writing API */
|
||||
|
||||
gboolean
|
||||
|
|
|
@ -277,8 +277,6 @@ struct _GPProcUninstall
|
|||
|
||||
|
||||
void gp_init (void);
|
||||
void gp_lock (void);
|
||||
void gp_unlock (void);
|
||||
|
||||
gboolean gp_quit_write (GIOChannel *channel,
|
||||
gpointer user_data);
|
||||
|
|
Loading…
Reference in New Issue