libmm-glib: use single mutex in each type to sync access
There is truly no need for a per-property mutex, using a global one for the whole object is equally fine.
This commit is contained in:
@@ -40,28 +40,26 @@
|
|||||||
G_DEFINE_TYPE (MMBearer, mm_bearer, MM_GDBUS_TYPE_BEARER_PROXY)
|
G_DEFINE_TYPE (MMBearer, mm_bearer, MM_GDBUS_TYPE_BEARER_PROXY)
|
||||||
|
|
||||||
struct _MMBearerPrivate {
|
struct _MMBearerPrivate {
|
||||||
|
/* Common mutex to sync access */
|
||||||
|
GMutex mutex;
|
||||||
|
|
||||||
/* IPv4 config */
|
/* IPv4 config */
|
||||||
GMutex ipv4_config_mutex;
|
|
||||||
guint ipv4_config_id;
|
guint ipv4_config_id;
|
||||||
MMBearerIpConfig *ipv4_config;
|
MMBearerIpConfig *ipv4_config;
|
||||||
|
|
||||||
/* IPv6 config */
|
/* IPv6 config */
|
||||||
GMutex ipv6_config_mutex;
|
|
||||||
guint ipv6_config_id;
|
guint ipv6_config_id;
|
||||||
MMBearerIpConfig *ipv6_config;
|
MMBearerIpConfig *ipv6_config;
|
||||||
|
|
||||||
/* Properties */
|
/* Properties */
|
||||||
GMutex properties_mutex;
|
|
||||||
guint properties_id;
|
guint properties_id;
|
||||||
MMBearerProperties *properties;
|
MMBearerProperties *properties;
|
||||||
|
|
||||||
/* Stats */
|
/* Stats */
|
||||||
GMutex stats_mutex;
|
|
||||||
guint stats_id;
|
guint stats_id;
|
||||||
MMBearerStats *stats;
|
MMBearerStats *stats;
|
||||||
|
|
||||||
/* Connection error */
|
/* Connection error */
|
||||||
GMutex connection_error_mutex;
|
|
||||||
guint connection_error_id;
|
guint connection_error_id;
|
||||||
GError *connection_error;
|
GError *connection_error;
|
||||||
};
|
};
|
||||||
@@ -296,7 +294,7 @@ static void
|
|||||||
ipv4_config_updated (MMBearer *self,
|
ipv4_config_updated (MMBearer *self,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
g_mutex_lock (&self->priv->ipv4_config_mutex);
|
g_mutex_lock (&self->priv->mutex);
|
||||||
{
|
{
|
||||||
GVariant *dictionary;
|
GVariant *dictionary;
|
||||||
|
|
||||||
@@ -314,14 +312,14 @@ ipv4_config_updated (MMBearer *self,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
g_mutex_unlock (&self->priv->ipv4_config_mutex);
|
g_mutex_unlock (&self->priv->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ensure_internal_ipv4_config (MMBearer *self,
|
ensure_internal_ipv4_config (MMBearer *self,
|
||||||
MMBearerIpConfig **dup)
|
MMBearerIpConfig **dup)
|
||||||
{
|
{
|
||||||
g_mutex_lock (&self->priv->ipv4_config_mutex);
|
g_mutex_lock (&self->priv->mutex);
|
||||||
{
|
{
|
||||||
/* If this is the first time ever asking for the object, setup the
|
/* If this is the first time ever asking for the object, setup the
|
||||||
* update listener and the initial object, if any. */
|
* update listener and the initial object, if any. */
|
||||||
@@ -351,7 +349,7 @@ ensure_internal_ipv4_config (MMBearer *self,
|
|||||||
if (dup && self->priv->ipv4_config)
|
if (dup && self->priv->ipv4_config)
|
||||||
*dup = g_object_ref (self->priv->ipv4_config);
|
*dup = g_object_ref (self->priv->ipv4_config);
|
||||||
}
|
}
|
||||||
g_mutex_unlock (&self->priv->ipv4_config_mutex);
|
g_mutex_unlock (&self->priv->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -414,7 +412,7 @@ static void
|
|||||||
ipv6_config_updated (MMBearer *self,
|
ipv6_config_updated (MMBearer *self,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
g_mutex_lock (&self->priv->ipv6_config_mutex);
|
g_mutex_lock (&self->priv->mutex);
|
||||||
{
|
{
|
||||||
GVariant *dictionary;
|
GVariant *dictionary;
|
||||||
|
|
||||||
@@ -432,14 +430,14 @@ ipv6_config_updated (MMBearer *self,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
g_mutex_unlock (&self->priv->ipv6_config_mutex);
|
g_mutex_unlock (&self->priv->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ensure_internal_ipv6_config (MMBearer *self,
|
ensure_internal_ipv6_config (MMBearer *self,
|
||||||
MMBearerIpConfig **dup)
|
MMBearerIpConfig **dup)
|
||||||
{
|
{
|
||||||
g_mutex_lock (&self->priv->ipv6_config_mutex);
|
g_mutex_lock (&self->priv->mutex);
|
||||||
{
|
{
|
||||||
/* If this is the first time ever asking for the object, setup the
|
/* If this is the first time ever asking for the object, setup the
|
||||||
* update listener and the initial object, if any. */
|
* update listener and the initial object, if any. */
|
||||||
@@ -469,7 +467,7 @@ ensure_internal_ipv6_config (MMBearer *self,
|
|||||||
if (dup && self->priv->ipv6_config)
|
if (dup && self->priv->ipv6_config)
|
||||||
*dup = g_object_ref (self->priv->ipv6_config);
|
*dup = g_object_ref (self->priv->ipv6_config);
|
||||||
}
|
}
|
||||||
g_mutex_unlock (&self->priv->ipv6_config_mutex);
|
g_mutex_unlock (&self->priv->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -532,7 +530,7 @@ static void
|
|||||||
properties_updated (MMBearer *self,
|
properties_updated (MMBearer *self,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
g_mutex_lock (&self->priv->properties_mutex);
|
g_mutex_lock (&self->priv->mutex);
|
||||||
{
|
{
|
||||||
GVariant *dictionary;
|
GVariant *dictionary;
|
||||||
|
|
||||||
@@ -550,14 +548,14 @@ properties_updated (MMBearer *self,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
g_mutex_unlock (&self->priv->properties_mutex);
|
g_mutex_unlock (&self->priv->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ensure_internal_properties (MMBearer *self,
|
ensure_internal_properties (MMBearer *self,
|
||||||
MMBearerProperties **dup)
|
MMBearerProperties **dup)
|
||||||
{
|
{
|
||||||
g_mutex_lock (&self->priv->properties_mutex);
|
g_mutex_lock (&self->priv->mutex);
|
||||||
{
|
{
|
||||||
/* If this is the first time ever asking for the object, setup the
|
/* If this is the first time ever asking for the object, setup the
|
||||||
* update listener and the initial object, if any. */
|
* update listener and the initial object, if any. */
|
||||||
@@ -587,7 +585,7 @@ ensure_internal_properties (MMBearer *self,
|
|||||||
if (dup && self->priv->properties)
|
if (dup && self->priv->properties)
|
||||||
*dup = g_object_ref (self->priv->properties);
|
*dup = g_object_ref (self->priv->properties);
|
||||||
}
|
}
|
||||||
g_mutex_unlock (&self->priv->properties_mutex);
|
g_mutex_unlock (&self->priv->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -650,7 +648,7 @@ static void
|
|||||||
stats_updated (MMBearer *self,
|
stats_updated (MMBearer *self,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
g_mutex_lock (&self->priv->stats_mutex);
|
g_mutex_lock (&self->priv->mutex);
|
||||||
{
|
{
|
||||||
GVariant *dictionary;
|
GVariant *dictionary;
|
||||||
|
|
||||||
@@ -667,14 +665,14 @@ stats_updated (MMBearer *self,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
g_mutex_unlock (&self->priv->stats_mutex);
|
g_mutex_unlock (&self->priv->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ensure_internal_stats (MMBearer *self,
|
ensure_internal_stats (MMBearer *self,
|
||||||
MMBearerStats **dup)
|
MMBearerStats **dup)
|
||||||
{
|
{
|
||||||
g_mutex_lock (&self->priv->stats_mutex);
|
g_mutex_lock (&self->priv->mutex);
|
||||||
{
|
{
|
||||||
/* If this is the first time ever asking for the object, setup the
|
/* If this is the first time ever asking for the object, setup the
|
||||||
* update listener and the initial object, if any. */
|
* update listener and the initial object, if any. */
|
||||||
@@ -704,7 +702,7 @@ ensure_internal_stats (MMBearer *self,
|
|||||||
if (dup && self->priv->stats)
|
if (dup && self->priv->stats)
|
||||||
*dup = g_object_ref (self->priv->stats);
|
*dup = g_object_ref (self->priv->stats);
|
||||||
}
|
}
|
||||||
g_mutex_unlock (&self->priv->stats_mutex);
|
g_mutex_unlock (&self->priv->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -767,7 +765,7 @@ static void
|
|||||||
connection_error_updated (MMBearer *self,
|
connection_error_updated (MMBearer *self,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
g_mutex_lock (&self->priv->connection_error_mutex);
|
g_mutex_lock (&self->priv->mutex);
|
||||||
{
|
{
|
||||||
GVariant *tuple;
|
GVariant *tuple;
|
||||||
|
|
||||||
@@ -782,14 +780,14 @@ connection_error_updated (MMBearer *self,
|
|||||||
g_warning ("Invalid bearer connection error update received: %s", error->message);
|
g_warning ("Invalid bearer connection error update received: %s", error->message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
g_mutex_unlock (&self->priv->connection_error_mutex);
|
g_mutex_unlock (&self->priv->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ensure_internal_connection_error (MMBearer *self,
|
ensure_internal_connection_error (MMBearer *self,
|
||||||
GError **dup)
|
GError **dup)
|
||||||
{
|
{
|
||||||
g_mutex_lock (&self->priv->connection_error_mutex);
|
g_mutex_lock (&self->priv->mutex);
|
||||||
{
|
{
|
||||||
/* If this is the first time ever asking for the object, setup the
|
/* If this is the first time ever asking for the object, setup the
|
||||||
* update listener and the initial object, if any. */
|
* update listener and the initial object, if any. */
|
||||||
@@ -816,7 +814,7 @@ ensure_internal_connection_error (MMBearer *self,
|
|||||||
if (dup && self->priv->connection_error)
|
if (dup && self->priv->connection_error)
|
||||||
*dup = g_error_copy (self->priv->connection_error);
|
*dup = g_error_copy (self->priv->connection_error);
|
||||||
}
|
}
|
||||||
g_mutex_unlock (&self->priv->connection_error_mutex);
|
g_mutex_unlock (&self->priv->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1040,15 +1038,8 @@ mm_bearer_disconnect_sync (MMBearer *self,
|
|||||||
static void
|
static void
|
||||||
mm_bearer_init (MMBearer *self)
|
mm_bearer_init (MMBearer *self)
|
||||||
{
|
{
|
||||||
/* Setup private data */
|
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, MM_TYPE_BEARER, MMBearerPrivate);
|
||||||
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
|
g_mutex_init (&self->priv->mutex);
|
||||||
MM_TYPE_BEARER,
|
|
||||||
MMBearerPrivate);
|
|
||||||
g_mutex_init (&self->priv->ipv4_config_mutex);
|
|
||||||
g_mutex_init (&self->priv->ipv6_config_mutex);
|
|
||||||
g_mutex_init (&self->priv->properties_mutex);
|
|
||||||
g_mutex_init (&self->priv->stats_mutex);
|
|
||||||
g_mutex_init (&self->priv->connection_error_mutex);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -1056,19 +1047,7 @@ finalize (GObject *object)
|
|||||||
{
|
{
|
||||||
MMBearer *self = MM_BEARER (object);
|
MMBearer *self = MM_BEARER (object);
|
||||||
|
|
||||||
g_mutex_clear (&self->priv->ipv4_config_mutex);
|
g_mutex_clear (&self->priv->mutex);
|
||||||
g_mutex_clear (&self->priv->ipv6_config_mutex);
|
|
||||||
g_mutex_clear (&self->priv->properties_mutex);
|
|
||||||
g_mutex_clear (&self->priv->stats_mutex);
|
|
||||||
g_mutex_clear (&self->priv->connection_error_mutex);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS (mm_bearer_parent_class)->finalize (object);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
dispose (GObject *object)
|
|
||||||
{
|
|
||||||
MMBearer *self = MM_BEARER (object);
|
|
||||||
|
|
||||||
g_clear_object (&self->priv->ipv4_config);
|
g_clear_object (&self->priv->ipv4_config);
|
||||||
g_clear_object (&self->priv->ipv6_config);
|
g_clear_object (&self->priv->ipv6_config);
|
||||||
@@ -1076,7 +1055,7 @@ dispose (GObject *object)
|
|||||||
g_clear_object (&self->priv->stats);
|
g_clear_object (&self->priv->stats);
|
||||||
g_clear_error (&self->priv->connection_error);
|
g_clear_error (&self->priv->connection_error);
|
||||||
|
|
||||||
G_OBJECT_CLASS (mm_bearer_parent_class)->dispose (object);
|
G_OBJECT_CLASS (mm_bearer_parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -1086,7 +1065,5 @@ mm_bearer_class_init (MMBearerClass *bearer_class)
|
|||||||
|
|
||||||
g_type_class_add_private (object_class, sizeof (MMBearerPrivate));
|
g_type_class_add_private (object_class, sizeof (MMBearerPrivate));
|
||||||
|
|
||||||
/* Virtual methods */
|
|
||||||
object_class->dispose = dispose;
|
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
}
|
}
|
||||||
|
@@ -37,8 +37,10 @@
|
|||||||
G_DEFINE_TYPE (MMCall, mm_call, MM_GDBUS_TYPE_CALL_PROXY)
|
G_DEFINE_TYPE (MMCall, mm_call, MM_GDBUS_TYPE_CALL_PROXY)
|
||||||
|
|
||||||
struct _MMCallPrivate {
|
struct _MMCallPrivate {
|
||||||
|
/* Common mutex to sync access */
|
||||||
|
GMutex mutex;
|
||||||
|
|
||||||
/* Audio Format */
|
/* Audio Format */
|
||||||
GMutex audio_format_mutex;
|
|
||||||
guint audio_format_id;
|
guint audio_format_id;
|
||||||
MMCallAudioFormat *audio_format;
|
MMCallAudioFormat *audio_format;
|
||||||
};
|
};
|
||||||
@@ -265,7 +267,7 @@ static void
|
|||||||
audio_format_updated (MMCall *self,
|
audio_format_updated (MMCall *self,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
g_mutex_lock (&self->priv->audio_format_mutex);
|
g_mutex_lock (&self->priv->mutex);
|
||||||
{
|
{
|
||||||
GVariant *dictionary;
|
GVariant *dictionary;
|
||||||
|
|
||||||
@@ -283,14 +285,14 @@ audio_format_updated (MMCall *self,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
g_mutex_unlock (&self->priv->audio_format_mutex);
|
g_mutex_unlock (&self->priv->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ensure_internal_audio_format (MMCall *self,
|
ensure_internal_audio_format (MMCall *self,
|
||||||
MMCallAudioFormat **dup)
|
MMCallAudioFormat **dup)
|
||||||
{
|
{
|
||||||
g_mutex_lock (&self->priv->audio_format_mutex);
|
g_mutex_lock (&self->priv->mutex);
|
||||||
{
|
{
|
||||||
/* If this is the first time ever asking for the object, setup the
|
/* If this is the first time ever asking for the object, setup the
|
||||||
* update listener and the initial object, if any. */
|
* update listener and the initial object, if any. */
|
||||||
@@ -320,7 +322,7 @@ ensure_internal_audio_format (MMCall *self,
|
|||||||
if (dup && self->priv->audio_format)
|
if (dup && self->priv->audio_format)
|
||||||
*dup = g_object_ref (self->priv->audio_format);
|
*dup = g_object_ref (self->priv->audio_format);
|
||||||
}
|
}
|
||||||
g_mutex_unlock (&self->priv->audio_format_mutex);
|
g_mutex_unlock (&self->priv->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1013,10 +1015,8 @@ mm_call_send_dtmf_sync (MMCall *self,
|
|||||||
static void
|
static void
|
||||||
mm_call_init (MMCall *self)
|
mm_call_init (MMCall *self)
|
||||||
{
|
{
|
||||||
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
|
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, MM_TYPE_CALL, MMCallPrivate);
|
||||||
MM_TYPE_CALL,
|
g_mutex_init (&self->priv->mutex);
|
||||||
MMCallPrivate);
|
|
||||||
g_mutex_init (&self->priv->audio_format_mutex);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -1024,19 +1024,11 @@ finalize (GObject *object)
|
|||||||
{
|
{
|
||||||
MMCall *self = MM_CALL (object);
|
MMCall *self = MM_CALL (object);
|
||||||
|
|
||||||
g_mutex_clear (&self->priv->audio_format_mutex);
|
g_mutex_clear (&self->priv->mutex);
|
||||||
|
|
||||||
G_OBJECT_CLASS (mm_call_parent_class)->finalize (object);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
dispose (GObject *object)
|
|
||||||
{
|
|
||||||
MMCall *self = MM_CALL (object);
|
|
||||||
|
|
||||||
g_clear_object (&self->priv->audio_format);
|
g_clear_object (&self->priv->audio_format);
|
||||||
|
|
||||||
G_OBJECT_CLASS (mm_call_parent_class)->dispose (object);
|
G_OBJECT_CLASS (mm_call_parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -1046,7 +1038,5 @@ mm_call_class_init (MMCallClass *call_class)
|
|||||||
|
|
||||||
g_type_class_add_private (object_class, sizeof (MMCallPrivate));
|
g_type_class_add_private (object_class, sizeof (MMCallPrivate));
|
||||||
|
|
||||||
/* Virtual methods */
|
|
||||||
object_class->dispose = dispose;
|
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
}
|
}
|
||||||
|
@@ -45,8 +45,10 @@
|
|||||||
G_DEFINE_TYPE (MMModem3gpp, mm_modem_3gpp, MM_GDBUS_TYPE_MODEM3GPP_PROXY)
|
G_DEFINE_TYPE (MMModem3gpp, mm_modem_3gpp, MM_GDBUS_TYPE_MODEM3GPP_PROXY)
|
||||||
|
|
||||||
struct _MMModem3gppPrivate {
|
struct _MMModem3gppPrivate {
|
||||||
|
/* Common mutex to sync access */
|
||||||
|
GMutex mutex;
|
||||||
|
|
||||||
/* Properties */
|
/* Properties */
|
||||||
GMutex initial_eps_bearer_settings_mutex;
|
|
||||||
guint initial_eps_bearer_settings_id;
|
guint initial_eps_bearer_settings_id;
|
||||||
MMBearerProperties *initial_eps_bearer_settings;
|
MMBearerProperties *initial_eps_bearer_settings;
|
||||||
};
|
};
|
||||||
@@ -632,7 +634,7 @@ static void
|
|||||||
initial_eps_bearer_settings_updated (MMModem3gpp *self,
|
initial_eps_bearer_settings_updated (MMModem3gpp *self,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
g_mutex_lock (&self->priv->initial_eps_bearer_settings_mutex);
|
g_mutex_lock (&self->priv->mutex);
|
||||||
{
|
{
|
||||||
GVariant *dictionary;
|
GVariant *dictionary;
|
||||||
|
|
||||||
@@ -649,14 +651,14 @@ initial_eps_bearer_settings_updated (MMModem3gpp *self,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
g_mutex_unlock (&self->priv->initial_eps_bearer_settings_mutex);
|
g_mutex_unlock (&self->priv->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ensure_internal_initial_eps_bearer_settings (MMModem3gpp *self,
|
ensure_internal_initial_eps_bearer_settings (MMModem3gpp *self,
|
||||||
MMBearerProperties **dup)
|
MMBearerProperties **dup)
|
||||||
{
|
{
|
||||||
g_mutex_lock (&self->priv->initial_eps_bearer_settings_mutex);
|
g_mutex_lock (&self->priv->mutex);
|
||||||
{
|
{
|
||||||
/* If this is the first time ever asking for the object, setup the
|
/* If this is the first time ever asking for the object, setup the
|
||||||
* update listener and the initial object, if any. */
|
* update listener and the initial object, if any. */
|
||||||
@@ -686,7 +688,7 @@ ensure_internal_initial_eps_bearer_settings (MMModem3gpp *self,
|
|||||||
if (dup && self->priv->initial_eps_bearer_settings)
|
if (dup && self->priv->initial_eps_bearer_settings)
|
||||||
*dup = g_object_ref (self->priv->initial_eps_bearer_settings);
|
*dup = g_object_ref (self->priv->initial_eps_bearer_settings);
|
||||||
}
|
}
|
||||||
g_mutex_unlock (&self->priv->initial_eps_bearer_settings_mutex);
|
g_mutex_unlock (&self->priv->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1283,7 +1285,7 @@ static void
|
|||||||
mm_modem_3gpp_init (MMModem3gpp *self)
|
mm_modem_3gpp_init (MMModem3gpp *self)
|
||||||
{
|
{
|
||||||
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, MM_TYPE_MODEM_3GPP, MMModem3gppPrivate);
|
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, MM_TYPE_MODEM_3GPP, MMModem3gppPrivate);
|
||||||
g_mutex_init (&self->priv->initial_eps_bearer_settings_mutex);
|
g_mutex_init (&self->priv->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -1291,19 +1293,11 @@ finalize (GObject *object)
|
|||||||
{
|
{
|
||||||
MMModem3gpp *self = MM_MODEM_3GPP (object);
|
MMModem3gpp *self = MM_MODEM_3GPP (object);
|
||||||
|
|
||||||
g_mutex_clear (&self->priv->initial_eps_bearer_settings_mutex);
|
g_mutex_clear (&self->priv->mutex);
|
||||||
|
|
||||||
G_OBJECT_CLASS (mm_modem_3gpp_parent_class)->finalize (object);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
dispose (GObject *object)
|
|
||||||
{
|
|
||||||
MMModem3gpp *self = MM_MODEM_3GPP (object);
|
|
||||||
|
|
||||||
g_clear_object (&self->priv->initial_eps_bearer_settings);
|
g_clear_object (&self->priv->initial_eps_bearer_settings);
|
||||||
|
|
||||||
G_OBJECT_CLASS (mm_modem_3gpp_parent_class)->dispose (object);
|
G_OBJECT_CLASS (mm_modem_3gpp_parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -1313,7 +1307,5 @@ mm_modem_3gpp_class_init (MMModem3gppClass *modem_class)
|
|||||||
|
|
||||||
g_type_class_add_private (object_class, sizeof (MMModem3gppPrivate));
|
g_type_class_add_private (object_class, sizeof (MMModem3gppPrivate));
|
||||||
|
|
||||||
/* Virtual methods */
|
|
||||||
object_class->dispose = dispose;
|
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
}
|
}
|
||||||
|
@@ -41,7 +41,9 @@
|
|||||||
G_DEFINE_TYPE (MMModemFirmware, mm_modem_firmware, MM_GDBUS_TYPE_MODEM_FIRMWARE_PROXY)
|
G_DEFINE_TYPE (MMModemFirmware, mm_modem_firmware, MM_GDBUS_TYPE_MODEM_FIRMWARE_PROXY)
|
||||||
|
|
||||||
struct _MMModemFirmwarePrivate {
|
struct _MMModemFirmwarePrivate {
|
||||||
GMutex update_settings_mutex;
|
/* Common mutex to sync access */
|
||||||
|
GMutex mutex;
|
||||||
|
|
||||||
guint update_settings_id;
|
guint update_settings_id;
|
||||||
MMFirmwareUpdateSettings *update_settings;
|
MMFirmwareUpdateSettings *update_settings;
|
||||||
};
|
};
|
||||||
@@ -98,7 +100,7 @@ static void
|
|||||||
update_settings_updated (MMModemFirmware *self,
|
update_settings_updated (MMModemFirmware *self,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
g_mutex_lock (&self->priv->update_settings_mutex);
|
g_mutex_lock (&self->priv->mutex);
|
||||||
{
|
{
|
||||||
GVariant *variant;
|
GVariant *variant;
|
||||||
|
|
||||||
@@ -114,14 +116,14 @@ update_settings_updated (MMModemFirmware *self,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
g_mutex_unlock (&self->priv->update_settings_mutex);
|
g_mutex_unlock (&self->priv->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ensure_internal_update_settings (MMModemFirmware *self,
|
ensure_internal_update_settings (MMModemFirmware *self,
|
||||||
MMFirmwareUpdateSettings **dupl)
|
MMFirmwareUpdateSettings **dupl)
|
||||||
{
|
{
|
||||||
g_mutex_lock (&self->priv->update_settings_mutex);
|
g_mutex_lock (&self->priv->mutex);
|
||||||
{
|
{
|
||||||
/* If this is the first time ever asking for the object, setup the
|
/* If this is the first time ever asking for the object, setup the
|
||||||
* update listener and the initial object, if any. */
|
* update listener and the initial object, if any. */
|
||||||
@@ -151,7 +153,7 @@ ensure_internal_update_settings (MMModemFirmware *self,
|
|||||||
if (dupl && self->priv->update_settings)
|
if (dupl && self->priv->update_settings)
|
||||||
*dupl = g_object_ref (self->priv->update_settings);
|
*dupl = g_object_ref (self->priv->update_settings);
|
||||||
}
|
}
|
||||||
g_mutex_unlock (&self->priv->update_settings_mutex);
|
g_mutex_unlock (&self->priv->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -533,7 +535,7 @@ static void
|
|||||||
mm_modem_firmware_init (MMModemFirmware *self)
|
mm_modem_firmware_init (MMModemFirmware *self)
|
||||||
{
|
{
|
||||||
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, MM_TYPE_MODEM_FIRMWARE, MMModemFirmwarePrivate);
|
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, MM_TYPE_MODEM_FIRMWARE, MMModemFirmwarePrivate);
|
||||||
g_mutex_init (&self->priv->update_settings_mutex);
|
g_mutex_init (&self->priv->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -541,19 +543,11 @@ finalize (GObject *object)
|
|||||||
{
|
{
|
||||||
MMModemFirmware *self = MM_MODEM_FIRMWARE (object);
|
MMModemFirmware *self = MM_MODEM_FIRMWARE (object);
|
||||||
|
|
||||||
g_mutex_clear (&self->priv->update_settings_mutex);
|
g_mutex_clear (&self->priv->mutex);
|
||||||
|
|
||||||
G_OBJECT_CLASS (mm_modem_firmware_parent_class)->finalize (object);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
dispose (GObject *object)
|
|
||||||
{
|
|
||||||
MMModemFirmware *self = MM_MODEM_FIRMWARE (object);
|
|
||||||
|
|
||||||
g_clear_object (&self->priv->update_settings);
|
g_clear_object (&self->priv->update_settings);
|
||||||
|
|
||||||
G_OBJECT_CLASS (mm_modem_firmware_parent_class)->dispose (object);
|
G_OBJECT_CLASS (mm_modem_firmware_parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -563,7 +557,5 @@ mm_modem_firmware_class_init (MMModemFirmwareClass *modem_class)
|
|||||||
|
|
||||||
g_type_class_add_private (object_class, sizeof (MMModemFirmwarePrivate));
|
g_type_class_add_private (object_class, sizeof (MMModemFirmwarePrivate));
|
||||||
|
|
||||||
/* Virtual methods */
|
|
||||||
object_class->dispose = dispose;
|
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
}
|
}
|
||||||
|
@@ -41,7 +41,9 @@
|
|||||||
G_DEFINE_TYPE (MMModemLocation, mm_modem_location, MM_GDBUS_TYPE_MODEM_LOCATION_PROXY)
|
G_DEFINE_TYPE (MMModemLocation, mm_modem_location, MM_GDBUS_TYPE_MODEM_LOCATION_PROXY)
|
||||||
|
|
||||||
struct _MMModemLocationPrivate {
|
struct _MMModemLocationPrivate {
|
||||||
GMutex signaled_location_mutex;
|
/* Common mutex to sync access */
|
||||||
|
GMutex mutex;
|
||||||
|
|
||||||
guint signaled_location_id;
|
guint signaled_location_id;
|
||||||
MMLocation3gpp *signaled_location_3gpp;
|
MMLocation3gpp *signaled_location_3gpp;
|
||||||
MMLocationGpsNmea *signaled_location_gps_nmea;
|
MMLocationGpsNmea *signaled_location_gps_nmea;
|
||||||
@@ -1219,7 +1221,7 @@ static void
|
|||||||
signaled_location_updated (MMModemLocation *self,
|
signaled_location_updated (MMModemLocation *self,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
g_mutex_lock (&self->priv->signaled_location_mutex);
|
g_mutex_lock (&self->priv->mutex);
|
||||||
{
|
{
|
||||||
GVariant *dictionary;
|
GVariant *dictionary;
|
||||||
|
|
||||||
@@ -1241,7 +1243,7 @@ signaled_location_updated (MMModemLocation *self,
|
|||||||
g_warning ("Invalid signaled location received: %s", error->message);
|
g_warning ("Invalid signaled location received: %s", error->message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
g_mutex_unlock (&self->priv->signaled_location_mutex);
|
g_mutex_unlock (&self->priv->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -1251,7 +1253,7 @@ ensure_internal_signaled_location (MMModemLocation *self,
|
|||||||
MMLocationGpsRaw **dupl_location_gps_raw,
|
MMLocationGpsRaw **dupl_location_gps_raw,
|
||||||
MMLocationCdmaBs **dupl_location_cdma_bs)
|
MMLocationCdmaBs **dupl_location_cdma_bs)
|
||||||
{
|
{
|
||||||
g_mutex_lock (&self->priv->signaled_location_mutex);
|
g_mutex_lock (&self->priv->mutex);
|
||||||
{
|
{
|
||||||
/* If this is the first time ever asking for the object, setup the
|
/* If this is the first time ever asking for the object, setup the
|
||||||
* update listener and the initial object, if any. */
|
* update listener and the initial object, if any. */
|
||||||
@@ -1288,7 +1290,7 @@ ensure_internal_signaled_location (MMModemLocation *self,
|
|||||||
if (dupl_location_cdma_bs && self->priv->signaled_location_cdma_bs)
|
if (dupl_location_cdma_bs && self->priv->signaled_location_cdma_bs)
|
||||||
*dupl_location_cdma_bs = g_object_ref (self->priv->signaled_location_cdma_bs);
|
*dupl_location_cdma_bs = g_object_ref (self->priv->signaled_location_cdma_bs);
|
||||||
}
|
}
|
||||||
g_mutex_unlock (&self->priv->signaled_location_mutex);
|
g_mutex_unlock (&self->priv->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1565,7 +1567,7 @@ static void
|
|||||||
mm_modem_location_init (MMModemLocation *self)
|
mm_modem_location_init (MMModemLocation *self)
|
||||||
{
|
{
|
||||||
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, MM_TYPE_MODEM_LOCATION, MMModemLocationPrivate);
|
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, MM_TYPE_MODEM_LOCATION, MMModemLocationPrivate);
|
||||||
g_mutex_init (&self->priv->signaled_location_mutex);
|
g_mutex_init (&self->priv->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -1573,22 +1575,14 @@ finalize (GObject *object)
|
|||||||
{
|
{
|
||||||
MMModemLocation *self = MM_MODEM_LOCATION (object);
|
MMModemLocation *self = MM_MODEM_LOCATION (object);
|
||||||
|
|
||||||
g_mutex_clear (&self->priv->signaled_location_mutex);
|
g_mutex_clear (&self->priv->mutex);
|
||||||
|
|
||||||
G_OBJECT_CLASS (mm_modem_location_parent_class)->finalize (object);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
dispose (GObject *object)
|
|
||||||
{
|
|
||||||
MMModemLocation *self = MM_MODEM_LOCATION (object);
|
|
||||||
|
|
||||||
g_clear_object (&self->priv->signaled_location_3gpp);
|
g_clear_object (&self->priv->signaled_location_3gpp);
|
||||||
g_clear_object (&self->priv->signaled_location_gps_nmea);
|
g_clear_object (&self->priv->signaled_location_gps_nmea);
|
||||||
g_clear_object (&self->priv->signaled_location_gps_raw);
|
g_clear_object (&self->priv->signaled_location_gps_raw);
|
||||||
g_clear_object (&self->priv->signaled_location_cdma_bs);
|
g_clear_object (&self->priv->signaled_location_cdma_bs);
|
||||||
|
|
||||||
G_OBJECT_CLASS (mm_modem_location_parent_class)->dispose (object);
|
G_OBJECT_CLASS (mm_modem_location_parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -1598,7 +1592,5 @@ mm_modem_location_class_init (MMModemLocationClass *modem_class)
|
|||||||
|
|
||||||
g_type_class_add_private (object_class, sizeof (MMModemLocationPrivate));
|
g_type_class_add_private (object_class, sizeof (MMModemLocationPrivate));
|
||||||
|
|
||||||
/* Virtual methods */
|
|
||||||
object_class->dispose = dispose;
|
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
}
|
}
|
||||||
|
@@ -42,8 +42,10 @@
|
|||||||
G_DEFINE_TYPE (MMModemMessaging, mm_modem_messaging, MM_GDBUS_TYPE_MODEM_MESSAGING_PROXY)
|
G_DEFINE_TYPE (MMModemMessaging, mm_modem_messaging, MM_GDBUS_TYPE_MODEM_MESSAGING_PROXY)
|
||||||
|
|
||||||
struct _MMModemMessagingPrivate {
|
struct _MMModemMessagingPrivate {
|
||||||
|
/* Common mutex to sync access */
|
||||||
|
GMutex mutex;
|
||||||
|
|
||||||
/* Supported Storage */
|
/* Supported Storage */
|
||||||
GMutex supported_storages_mutex;
|
|
||||||
guint supported_storages_id;
|
guint supported_storages_id;
|
||||||
GArray *supported_storages;
|
GArray *supported_storages;
|
||||||
};
|
};
|
||||||
@@ -100,7 +102,7 @@ static void
|
|||||||
supported_storages_updated (MMModemMessaging *self,
|
supported_storages_updated (MMModemMessaging *self,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
g_mutex_lock (&self->priv->supported_storages_mutex);
|
g_mutex_lock (&self->priv->mutex);
|
||||||
{
|
{
|
||||||
GVariant *dictionary;
|
GVariant *dictionary;
|
||||||
|
|
||||||
@@ -112,7 +114,7 @@ supported_storages_updated (MMModemMessaging *self,
|
|||||||
mm_common_sms_storages_variant_to_garray (dictionary) :
|
mm_common_sms_storages_variant_to_garray (dictionary) :
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
g_mutex_unlock (&self->priv->supported_storages_mutex);
|
g_mutex_unlock (&self->priv->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@@ -122,7 +124,7 @@ ensure_internal_supported_storages (MMModemMessaging *self,
|
|||||||
{
|
{
|
||||||
gboolean ret;
|
gboolean ret;
|
||||||
|
|
||||||
g_mutex_lock (&self->priv->supported_storages_mutex);
|
g_mutex_lock (&self->priv->mutex);
|
||||||
{
|
{
|
||||||
/* If this is the first time ever asking for the array, setup the
|
/* If this is the first time ever asking for the array, setup the
|
||||||
* update listener and the initial array, if any. */
|
* update listener and the initial array, if any. */
|
||||||
@@ -158,7 +160,7 @@ ensure_internal_supported_storages (MMModemMessaging *self,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
g_mutex_unlock (&self->priv->supported_storages_mutex);
|
g_mutex_unlock (&self->priv->mutex);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -734,11 +736,8 @@ mm_modem_messaging_delete_sync (MMModemMessaging *self,
|
|||||||
static void
|
static void
|
||||||
mm_modem_messaging_init (MMModemMessaging *self)
|
mm_modem_messaging_init (MMModemMessaging *self)
|
||||||
{
|
{
|
||||||
/* Setup private data */
|
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, MM_TYPE_MODEM_MESSAGING, MMModemMessagingPrivate);
|
||||||
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
|
g_mutex_init (&self->priv->mutex);
|
||||||
MM_TYPE_MODEM_MESSAGING,
|
|
||||||
MMModemMessagingPrivate);
|
|
||||||
g_mutex_init (&self->priv->supported_storages_mutex);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -746,10 +745,9 @@ finalize (GObject *object)
|
|||||||
{
|
{
|
||||||
MMModemMessaging *self = MM_MODEM_MESSAGING (object);
|
MMModemMessaging *self = MM_MODEM_MESSAGING (object);
|
||||||
|
|
||||||
g_mutex_clear (&self->priv->supported_storages_mutex);
|
g_mutex_clear (&self->priv->mutex);
|
||||||
|
|
||||||
if (self->priv->supported_storages)
|
g_clear_pointer (&self->priv->supported_storages, g_array_unref);
|
||||||
g_array_unref (self->priv->supported_storages);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS (mm_modem_messaging_parent_class)->finalize (object);
|
G_OBJECT_CLASS (mm_modem_messaging_parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
@@ -761,6 +759,5 @@ mm_modem_messaging_class_init (MMModemMessagingClass *modem_class)
|
|||||||
|
|
||||||
g_type_class_add_private (object_class, sizeof (MMModemMessagingPrivate));
|
g_type_class_add_private (object_class, sizeof (MMModemMessagingPrivate));
|
||||||
|
|
||||||
/* Virtual methods */
|
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
}
|
}
|
||||||
|
@@ -43,8 +43,10 @@
|
|||||||
G_DEFINE_TYPE (MMModemOma, mm_modem_oma, MM_GDBUS_TYPE_MODEM_OMA_PROXY)
|
G_DEFINE_TYPE (MMModemOma, mm_modem_oma, MM_GDBUS_TYPE_MODEM_OMA_PROXY)
|
||||||
|
|
||||||
struct _MMModemOmaPrivate {
|
struct _MMModemOmaPrivate {
|
||||||
|
/* Common mutex to sync access */
|
||||||
|
GMutex mutex;
|
||||||
|
|
||||||
/* Supported Modes */
|
/* Supported Modes */
|
||||||
GMutex pending_network_initiated_sessions_mutex;
|
|
||||||
guint pending_network_initiated_sessions_id;
|
guint pending_network_initiated_sessions_id;
|
||||||
GArray *pending_network_initiated_sessions;
|
GArray *pending_network_initiated_sessions;
|
||||||
};
|
};
|
||||||
@@ -507,7 +509,7 @@ static void
|
|||||||
pending_network_initiated_sessions_updated (MMModemOma *self,
|
pending_network_initiated_sessions_updated (MMModemOma *self,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
g_mutex_lock (&self->priv->pending_network_initiated_sessions_mutex);
|
g_mutex_lock (&self->priv->mutex);
|
||||||
{
|
{
|
||||||
GVariant *dictionary;
|
GVariant *dictionary;
|
||||||
|
|
||||||
@@ -519,7 +521,7 @@ pending_network_initiated_sessions_updated (MMModemOma *self,
|
|||||||
mm_common_oma_pending_network_initiated_sessions_variant_to_garray (dictionary) :
|
mm_common_oma_pending_network_initiated_sessions_variant_to_garray (dictionary) :
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
g_mutex_unlock (&self->priv->pending_network_initiated_sessions_mutex);
|
g_mutex_unlock (&self->priv->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@@ -529,7 +531,7 @@ ensure_internal_pending_network_initiated_sessions (MMModemOma *self,
|
|||||||
{
|
{
|
||||||
gboolean ret;
|
gboolean ret;
|
||||||
|
|
||||||
g_mutex_lock (&self->priv->pending_network_initiated_sessions_mutex);
|
g_mutex_lock (&self->priv->mutex);
|
||||||
{
|
{
|
||||||
/* If this is the first time ever asking for the array, setup the
|
/* If this is the first time ever asking for the array, setup the
|
||||||
* update listener and the initial array, if any. */
|
* update listener and the initial array, if any. */
|
||||||
@@ -565,7 +567,7 @@ ensure_internal_pending_network_initiated_sessions (MMModemOma *self,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
g_mutex_unlock (&self->priv->pending_network_initiated_sessions_mutex);
|
g_mutex_unlock (&self->priv->mutex);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -632,11 +634,8 @@ mm_modem_oma_peek_pending_network_initiated_sessions (MMModemOma
|
|||||||
static void
|
static void
|
||||||
mm_modem_oma_init (MMModemOma *self)
|
mm_modem_oma_init (MMModemOma *self)
|
||||||
{
|
{
|
||||||
/* Setup private data */
|
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, MM_TYPE_MODEM_OMA, MMModemOmaPrivate);
|
||||||
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
|
g_mutex_init (&self->priv->mutex);
|
||||||
MM_TYPE_MODEM_OMA,
|
|
||||||
MMModemOmaPrivate);
|
|
||||||
g_mutex_init (&self->priv->pending_network_initiated_sessions_mutex);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -644,10 +643,9 @@ finalize (GObject *object)
|
|||||||
{
|
{
|
||||||
MMModemOma *self = MM_MODEM_OMA (object);
|
MMModemOma *self = MM_MODEM_OMA (object);
|
||||||
|
|
||||||
g_mutex_clear (&self->priv->pending_network_initiated_sessions_mutex);
|
g_mutex_clear (&self->priv->mutex);
|
||||||
|
|
||||||
if (self->priv->pending_network_initiated_sessions)
|
g_clear_pointer (&self->priv->pending_network_initiated_sessions, g_array_unref);
|
||||||
g_array_unref (self->priv->pending_network_initiated_sessions);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS (mm_modem_oma_parent_class)->finalize (object);
|
G_OBJECT_CLASS (mm_modem_oma_parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
@@ -659,6 +657,5 @@ mm_modem_oma_class_init (MMModemOmaClass *modem_class)
|
|||||||
|
|
||||||
g_type_class_add_private (object_class, sizeof (MMModemOmaPrivate));
|
g_type_class_add_private (object_class, sizeof (MMModemOmaPrivate));
|
||||||
|
|
||||||
/* Virtual methods */
|
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
}
|
}
|
||||||
|
@@ -42,8 +42,7 @@
|
|||||||
G_DEFINE_TYPE (MMModemSignal, mm_modem_signal, MM_GDBUS_TYPE_MODEM_SIGNAL_PROXY)
|
G_DEFINE_TYPE (MMModemSignal, mm_modem_signal, MM_GDBUS_TYPE_MODEM_SIGNAL_PROXY)
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
GMutex mutex;
|
guint id;
|
||||||
guint id;
|
|
||||||
MMSignal *info;
|
MMSignal *info;
|
||||||
} UpdatedProperty;
|
} UpdatedProperty;
|
||||||
|
|
||||||
@@ -58,6 +57,9 @@ typedef enum {
|
|||||||
} UpdatedPropertyType;
|
} UpdatedPropertyType;
|
||||||
|
|
||||||
struct _MMModemSignalPrivate {
|
struct _MMModemSignalPrivate {
|
||||||
|
/* Common mutex to sync access */
|
||||||
|
GMutex mutex;
|
||||||
|
|
||||||
UpdatedProperty values [UPDATED_PROPERTY_TYPE_LAST];
|
UpdatedProperty values [UPDATED_PROPERTY_TYPE_LAST];
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -282,7 +284,7 @@ values_updated (MMModemSignal *self,
|
|||||||
GParamSpec *pspec,
|
GParamSpec *pspec,
|
||||||
UpdatedPropertyType type)
|
UpdatedPropertyType type)
|
||||||
{
|
{
|
||||||
g_mutex_lock (&self->priv->values[type].mutex);
|
g_mutex_lock (&self->priv->mutex);
|
||||||
{
|
{
|
||||||
GVariant *dictionary;
|
GVariant *dictionary;
|
||||||
|
|
||||||
@@ -298,7 +300,7 @@ values_updated (MMModemSignal *self,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
g_mutex_unlock (&self->priv->values[type].mutex);
|
g_mutex_unlock (&self->priv->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -306,7 +308,7 @@ ensure_internal (MMModemSignal *self,
|
|||||||
MMSignal **dup,
|
MMSignal **dup,
|
||||||
UpdatedPropertyType type)
|
UpdatedPropertyType type)
|
||||||
{
|
{
|
||||||
g_mutex_lock (&self->priv->values[type].mutex);
|
g_mutex_lock (&self->priv->mutex);
|
||||||
{
|
{
|
||||||
/* If this is the first time ever asking for the object, setup the
|
/* If this is the first time ever asking for the object, setup the
|
||||||
* update listener and the initial object, if any. */
|
* update listener and the initial object, if any. */
|
||||||
@@ -336,7 +338,7 @@ ensure_internal (MMModemSignal *self,
|
|||||||
if (dup && self->priv->values[type].info)
|
if (dup && self->priv->values[type].info)
|
||||||
*dup = g_object_ref (self->priv->values[type].info);
|
*dup = g_object_ref (self->priv->values[type].info);
|
||||||
}
|
}
|
||||||
g_mutex_unlock (&self->priv->values[type].mutex);
|
g_mutex_unlock (&self->priv->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
@@ -660,13 +662,8 @@ mm_modem_signal_peek_nr5g (MMModemSignal *self)
|
|||||||
static void
|
static void
|
||||||
mm_modem_signal_init (MMModemSignal *self)
|
mm_modem_signal_init (MMModemSignal *self)
|
||||||
{
|
{
|
||||||
guint i;
|
|
||||||
|
|
||||||
/* Setup private data */
|
|
||||||
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, MM_TYPE_MODEM_SIGNAL, MMModemSignalPrivate);
|
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, MM_TYPE_MODEM_SIGNAL, MMModemSignalPrivate);
|
||||||
|
g_mutex_init (&self->priv->mutex);
|
||||||
for (i = 0; i < UPDATED_PROPERTY_TYPE_LAST; i++)
|
|
||||||
g_mutex_init (&self->priv->values[i].mutex);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -675,22 +672,12 @@ finalize (GObject *object)
|
|||||||
MMModemSignal *self = MM_MODEM_SIGNAL (object);
|
MMModemSignal *self = MM_MODEM_SIGNAL (object);
|
||||||
guint i;
|
guint i;
|
||||||
|
|
||||||
for (i = 0; i < UPDATED_PROPERTY_TYPE_LAST; i++)
|
g_mutex_clear (&self->priv->mutex);
|
||||||
g_mutex_clear (&self->priv->values[i].mutex);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS (mm_modem_signal_parent_class)->finalize (object);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
dispose (GObject *object)
|
|
||||||
{
|
|
||||||
MMModemSignal *self = MM_MODEM_SIGNAL (object);
|
|
||||||
guint i;
|
|
||||||
|
|
||||||
for (i = 0; i < UPDATED_PROPERTY_TYPE_LAST; i++)
|
for (i = 0; i < UPDATED_PROPERTY_TYPE_LAST; i++)
|
||||||
g_clear_object (&self->priv->values[i].info);
|
g_clear_object (&self->priv->values[i].info);
|
||||||
|
|
||||||
G_OBJECT_CLASS (mm_modem_signal_parent_class)->dispose (object);
|
G_OBJECT_CLASS (mm_modem_signal_parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -700,7 +687,5 @@ mm_modem_signal_class_init (MMModemSignalClass *modem_class)
|
|||||||
|
|
||||||
g_type_class_add_private (object_class, sizeof (MMModemSignalPrivate));
|
g_type_class_add_private (object_class, sizeof (MMModemSignalPrivate));
|
||||||
|
|
||||||
/* Virtual methods */
|
|
||||||
object_class->dispose = dispose;
|
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
}
|
}
|
||||||
|
@@ -41,8 +41,10 @@
|
|||||||
G_DEFINE_TYPE (MMModemTime, mm_modem_time, MM_GDBUS_TYPE_MODEM_TIME_PROXY)
|
G_DEFINE_TYPE (MMModemTime, mm_modem_time, MM_GDBUS_TYPE_MODEM_TIME_PROXY)
|
||||||
|
|
||||||
struct _MMModemTimePrivate {
|
struct _MMModemTimePrivate {
|
||||||
|
/* Common mutex to sync access */
|
||||||
|
GMutex mutex;
|
||||||
|
|
||||||
/* Timezone */
|
/* Timezone */
|
||||||
GMutex timezone_mutex;
|
|
||||||
guint timezone_id;
|
guint timezone_id;
|
||||||
MMNetworkTimezone *timezone;
|
MMNetworkTimezone *timezone;
|
||||||
};
|
};
|
||||||
@@ -195,7 +197,7 @@ static void
|
|||||||
timezone_updated (MMModemTime *self,
|
timezone_updated (MMModemTime *self,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
g_mutex_lock (&self->priv->timezone_mutex);
|
g_mutex_lock (&self->priv->mutex);
|
||||||
{
|
{
|
||||||
GVariant *dictionary;
|
GVariant *dictionary;
|
||||||
|
|
||||||
@@ -205,14 +207,14 @@ timezone_updated (MMModemTime *self,
|
|||||||
mm_network_timezone_new_from_dictionary (dictionary, NULL) :
|
mm_network_timezone_new_from_dictionary (dictionary, NULL) :
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
g_mutex_unlock (&self->priv->timezone_mutex);
|
g_mutex_unlock (&self->priv->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ensure_internal_timezone (MMModemTime *self,
|
ensure_internal_timezone (MMModemTime *self,
|
||||||
MMNetworkTimezone **dup)
|
MMNetworkTimezone **dup)
|
||||||
{
|
{
|
||||||
g_mutex_lock (&self->priv->timezone_mutex);
|
g_mutex_lock (&self->priv->mutex);
|
||||||
{
|
{
|
||||||
/* If this is the first time ever asking for the object, setup the
|
/* If this is the first time ever asking for the object, setup the
|
||||||
* update listener and the initial object, if any. */
|
* update listener and the initial object, if any. */
|
||||||
@@ -236,7 +238,7 @@ ensure_internal_timezone (MMModemTime *self,
|
|||||||
if (dup && self->priv->timezone)
|
if (dup && self->priv->timezone)
|
||||||
*dup = g_object_ref (self->priv->timezone);
|
*dup = g_object_ref (self->priv->timezone);
|
||||||
}
|
}
|
||||||
g_mutex_unlock (&self->priv->timezone_mutex);
|
g_mutex_unlock (&self->priv->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -295,21 +297,8 @@ mm_modem_time_peek_network_timezone (MMModemTime *self)
|
|||||||
static void
|
static void
|
||||||
mm_modem_time_init (MMModemTime *self)
|
mm_modem_time_init (MMModemTime *self)
|
||||||
{
|
{
|
||||||
/* Setup private data */
|
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, MM_TYPE_MODEM_TIME, MMModemTimePrivate);
|
||||||
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
|
g_mutex_init (&self->priv->mutex);
|
||||||
MM_TYPE_MODEM_TIME,
|
|
||||||
MMModemTimePrivate);
|
|
||||||
g_mutex_init (&self->priv->timezone_mutex);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
dispose (GObject *object)
|
|
||||||
{
|
|
||||||
MMModemTime *self = MM_MODEM_TIME (object);
|
|
||||||
|
|
||||||
g_clear_object (&self->priv->timezone);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS (mm_modem_time_parent_class)->dispose (object);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -317,7 +306,9 @@ finalize (GObject *object)
|
|||||||
{
|
{
|
||||||
MMModemTime *self = MM_MODEM_TIME (object);
|
MMModemTime *self = MM_MODEM_TIME (object);
|
||||||
|
|
||||||
g_mutex_clear (&self->priv->timezone_mutex);
|
g_mutex_clear (&self->priv->mutex);
|
||||||
|
|
||||||
|
g_clear_object (&self->priv->timezone);
|
||||||
|
|
||||||
G_OBJECT_CLASS (mm_modem_time_parent_class)->finalize (object);
|
G_OBJECT_CLASS (mm_modem_time_parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
@@ -329,7 +320,5 @@ mm_modem_time_class_init (MMModemTimeClass *modem_class)
|
|||||||
|
|
||||||
g_type_class_add_private (object_class, sizeof (MMModemTimePrivate));
|
g_type_class_add_private (object_class, sizeof (MMModemTimePrivate));
|
||||||
|
|
||||||
/* Virtual methods */
|
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
object_class->dispose = dispose;
|
|
||||||
}
|
}
|
||||||
|
@@ -44,33 +44,30 @@
|
|||||||
G_DEFINE_TYPE (MMModem, mm_modem, MM_GDBUS_TYPE_MODEM_PROXY)
|
G_DEFINE_TYPE (MMModem, mm_modem, MM_GDBUS_TYPE_MODEM_PROXY)
|
||||||
|
|
||||||
struct _MMModemPrivate {
|
struct _MMModemPrivate {
|
||||||
|
/* Common mutex to sync access */
|
||||||
|
GMutex mutex;
|
||||||
|
|
||||||
/* Ports */
|
/* Ports */
|
||||||
GMutex ports_mutex;
|
|
||||||
guint ports_id;
|
guint ports_id;
|
||||||
GArray *ports;
|
GArray *ports;
|
||||||
|
|
||||||
/* UnlockRetries */
|
/* UnlockRetries */
|
||||||
GMutex unlock_retries_mutex;
|
|
||||||
guint unlock_retries_id;
|
guint unlock_retries_id;
|
||||||
MMUnlockRetries *unlock_retries;
|
MMUnlockRetries *unlock_retries;
|
||||||
|
|
||||||
/* Supported Modes */
|
/* Supported Modes */
|
||||||
GMutex supported_modes_mutex;
|
|
||||||
guint supported_modes_id;
|
guint supported_modes_id;
|
||||||
GArray *supported_modes;
|
GArray *supported_modes;
|
||||||
|
|
||||||
/* Supported Capabilities */
|
/* Supported Capabilities */
|
||||||
GMutex supported_capabilities_mutex;
|
|
||||||
guint supported_capabilities_id;
|
guint supported_capabilities_id;
|
||||||
GArray *supported_capabilities;
|
GArray *supported_capabilities;
|
||||||
|
|
||||||
/* Supported Bands */
|
/* Supported Bands */
|
||||||
GMutex supported_bands_mutex;
|
|
||||||
guint supported_bands_id;
|
guint supported_bands_id;
|
||||||
GArray *supported_bands;
|
GArray *supported_bands;
|
||||||
|
|
||||||
/* Current Bands */
|
/* Current Bands */
|
||||||
GMutex current_bands_mutex;
|
|
||||||
guint current_bands_id;
|
guint current_bands_id;
|
||||||
GArray *current_bands;
|
GArray *current_bands;
|
||||||
};
|
};
|
||||||
@@ -248,7 +245,7 @@ static void
|
|||||||
supported_capabilities_updated (MMModem *self,
|
supported_capabilities_updated (MMModem *self,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
g_mutex_lock (&self->priv->supported_capabilities_mutex);
|
g_mutex_lock (&self->priv->mutex);
|
||||||
{
|
{
|
||||||
GVariant *dictionary;
|
GVariant *dictionary;
|
||||||
|
|
||||||
@@ -260,7 +257,7 @@ supported_capabilities_updated (MMModem *self,
|
|||||||
mm_common_capability_combinations_variant_to_garray (dictionary) :
|
mm_common_capability_combinations_variant_to_garray (dictionary) :
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
g_mutex_unlock (&self->priv->supported_capabilities_mutex);
|
g_mutex_unlock (&self->priv->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@@ -270,7 +267,7 @@ ensure_internal_supported_capabilities (MMModem *self,
|
|||||||
{
|
{
|
||||||
gboolean ret;
|
gboolean ret;
|
||||||
|
|
||||||
g_mutex_lock (&self->priv->supported_capabilities_mutex);
|
g_mutex_lock (&self->priv->mutex);
|
||||||
{
|
{
|
||||||
/* If this is the first time ever asking for the array, setup the
|
/* If this is the first time ever asking for the array, setup the
|
||||||
* update listener and the initial array, if any. */
|
* update listener and the initial array, if any. */
|
||||||
@@ -306,7 +303,7 @@ ensure_internal_supported_capabilities (MMModem *self,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
g_mutex_unlock (&self->priv->supported_capabilities_mutex);
|
g_mutex_unlock (&self->priv->mutex);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -1026,7 +1023,7 @@ static void
|
|||||||
ports_updated (MMModem *self,
|
ports_updated (MMModem *self,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
g_mutex_lock (&self->priv->ports_mutex);
|
g_mutex_lock (&self->priv->mutex);
|
||||||
{
|
{
|
||||||
GVariant *dictionary;
|
GVariant *dictionary;
|
||||||
|
|
||||||
@@ -1038,7 +1035,7 @@ ports_updated (MMModem *self,
|
|||||||
mm_common_ports_variant_to_garray (dictionary) :
|
mm_common_ports_variant_to_garray (dictionary) :
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
g_mutex_unlock (&self->priv->ports_mutex);
|
g_mutex_unlock (&self->priv->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@@ -1049,7 +1046,7 @@ ensure_internal_ports (MMModem *self,
|
|||||||
gboolean ret;
|
gboolean ret;
|
||||||
guint i;
|
guint i;
|
||||||
|
|
||||||
g_mutex_lock (&self->priv->ports_mutex);
|
g_mutex_lock (&self->priv->mutex);
|
||||||
{
|
{
|
||||||
/* If this is the first time ever asking for the array, setup the
|
/* If this is the first time ever asking for the array, setup the
|
||||||
* update listener and the initial array, if any. */
|
* update listener and the initial array, if any. */
|
||||||
@@ -1093,7 +1090,7 @@ ensure_internal_ports (MMModem *self,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
g_mutex_unlock (&self->priv->ports_mutex);
|
g_mutex_unlock (&self->priv->mutex);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -1290,7 +1287,7 @@ static void
|
|||||||
unlock_retries_updated (MMModem *self,
|
unlock_retries_updated (MMModem *self,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
g_mutex_lock (&self->priv->unlock_retries_mutex);
|
g_mutex_lock (&self->priv->mutex);
|
||||||
{
|
{
|
||||||
GVariant *dictionary;
|
GVariant *dictionary;
|
||||||
|
|
||||||
@@ -1301,14 +1298,14 @@ unlock_retries_updated (MMModem *self,
|
|||||||
if (dictionary)
|
if (dictionary)
|
||||||
self->priv->unlock_retries = mm_unlock_retries_new_from_dictionary (dictionary);
|
self->priv->unlock_retries = mm_unlock_retries_new_from_dictionary (dictionary);
|
||||||
}
|
}
|
||||||
g_mutex_unlock (&self->priv->unlock_retries_mutex);
|
g_mutex_unlock (&self->priv->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ensure_internal_unlock_retries (MMModem *self,
|
ensure_internal_unlock_retries (MMModem *self,
|
||||||
MMUnlockRetries **dup)
|
MMUnlockRetries **dup)
|
||||||
{
|
{
|
||||||
g_mutex_lock (&self->priv->unlock_retries_mutex);
|
g_mutex_lock (&self->priv->mutex);
|
||||||
{
|
{
|
||||||
/* If this is the first time ever asking for the object, setup the
|
/* If this is the first time ever asking for the object, setup the
|
||||||
* update listener and the initial object, if any. */
|
* update listener and the initial object, if any. */
|
||||||
@@ -1332,7 +1329,7 @@ ensure_internal_unlock_retries (MMModem *self,
|
|||||||
if (dup && self->priv->unlock_retries)
|
if (dup && self->priv->unlock_retries)
|
||||||
*dup = g_object_ref (self->priv->unlock_retries);
|
*dup = g_object_ref (self->priv->unlock_retries);
|
||||||
}
|
}
|
||||||
g_mutex_unlock (&self->priv->unlock_retries_mutex);
|
g_mutex_unlock (&self->priv->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1520,7 +1517,7 @@ static void
|
|||||||
supported_modes_updated (MMModem *self,
|
supported_modes_updated (MMModem *self,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
g_mutex_lock (&self->priv->supported_modes_mutex);
|
g_mutex_lock (&self->priv->mutex);
|
||||||
{
|
{
|
||||||
GVariant *dictionary;
|
GVariant *dictionary;
|
||||||
|
|
||||||
@@ -1532,7 +1529,7 @@ supported_modes_updated (MMModem *self,
|
|||||||
mm_common_mode_combinations_variant_to_garray (dictionary) :
|
mm_common_mode_combinations_variant_to_garray (dictionary) :
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
g_mutex_unlock (&self->priv->supported_modes_mutex);
|
g_mutex_unlock (&self->priv->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@@ -1542,7 +1539,7 @@ ensure_internal_supported_modes (MMModem *self,
|
|||||||
{
|
{
|
||||||
gboolean ret;
|
gboolean ret;
|
||||||
|
|
||||||
g_mutex_lock (&self->priv->supported_modes_mutex);
|
g_mutex_lock (&self->priv->mutex);
|
||||||
{
|
{
|
||||||
/* If this is the first time ever asking for the array, setup the
|
/* If this is the first time ever asking for the array, setup the
|
||||||
* update listener and the initial array, if any. */
|
* update listener and the initial array, if any. */
|
||||||
@@ -1578,7 +1575,7 @@ ensure_internal_supported_modes (MMModem *self,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
g_mutex_unlock (&self->priv->supported_modes_mutex);
|
g_mutex_unlock (&self->priv->mutex);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -1686,7 +1683,7 @@ static void
|
|||||||
supported_bands_updated (MMModem *self,
|
supported_bands_updated (MMModem *self,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
g_mutex_lock (&self->priv->supported_bands_mutex);
|
g_mutex_lock (&self->priv->mutex);
|
||||||
{
|
{
|
||||||
GVariant *dictionary;
|
GVariant *dictionary;
|
||||||
|
|
||||||
@@ -1698,7 +1695,7 @@ supported_bands_updated (MMModem *self,
|
|||||||
mm_common_bands_variant_to_garray (dictionary) :
|
mm_common_bands_variant_to_garray (dictionary) :
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
g_mutex_unlock (&self->priv->supported_bands_mutex);
|
g_mutex_unlock (&self->priv->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@@ -1708,7 +1705,7 @@ ensure_internal_supported_bands (MMModem *self,
|
|||||||
{
|
{
|
||||||
gboolean ret;
|
gboolean ret;
|
||||||
|
|
||||||
g_mutex_lock (&self->priv->supported_bands_mutex);
|
g_mutex_lock (&self->priv->mutex);
|
||||||
{
|
{
|
||||||
/* If this is the first time ever asking for the array, setup the
|
/* If this is the first time ever asking for the array, setup the
|
||||||
* update listener and the initial array, if any. */
|
* update listener and the initial array, if any. */
|
||||||
@@ -1744,7 +1741,7 @@ ensure_internal_supported_bands (MMModem *self,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
g_mutex_unlock (&self->priv->supported_bands_mutex);
|
g_mutex_unlock (&self->priv->mutex);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -1817,7 +1814,7 @@ static void
|
|||||||
current_bands_updated (MMModem *self,
|
current_bands_updated (MMModem *self,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
g_mutex_lock (&self->priv->current_bands_mutex);
|
g_mutex_lock (&self->priv->mutex);
|
||||||
{
|
{
|
||||||
GVariant *dictionary;
|
GVariant *dictionary;
|
||||||
|
|
||||||
@@ -1829,7 +1826,7 @@ current_bands_updated (MMModem *self,
|
|||||||
mm_common_bands_variant_to_garray (dictionary) :
|
mm_common_bands_variant_to_garray (dictionary) :
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
g_mutex_unlock (&self->priv->current_bands_mutex);
|
g_mutex_unlock (&self->priv->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@@ -1839,7 +1836,7 @@ ensure_internal_current_bands (MMModem *self,
|
|||||||
{
|
{
|
||||||
gboolean ret;
|
gboolean ret;
|
||||||
|
|
||||||
g_mutex_lock (&self->priv->current_bands_mutex);
|
g_mutex_lock (&self->priv->mutex);
|
||||||
{
|
{
|
||||||
/* If this is the first time ever asking for the array, setup the
|
/* If this is the first time ever asking for the array, setup the
|
||||||
* update listener and the initial array, if any. */
|
* update listener and the initial array, if any. */
|
||||||
@@ -1875,7 +1872,7 @@ ensure_internal_current_bands (MMModem *self,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
g_mutex_unlock (&self->priv->current_bands_mutex);
|
g_mutex_unlock (&self->priv->mutex);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -3782,16 +3779,8 @@ mm_modem_set_primary_sim_slot_sync (MMModem *self,
|
|||||||
static void
|
static void
|
||||||
mm_modem_init (MMModem *self)
|
mm_modem_init (MMModem *self)
|
||||||
{
|
{
|
||||||
/* Setup private data */
|
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, MM_TYPE_MODEM, MMModemPrivate);
|
||||||
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
|
g_mutex_init (&self->priv->mutex);
|
||||||
MM_TYPE_MODEM,
|
|
||||||
MMModemPrivate);
|
|
||||||
g_mutex_init (&self->priv->unlock_retries_mutex);
|
|
||||||
g_mutex_init (&self->priv->supported_modes_mutex);
|
|
||||||
g_mutex_init (&self->priv->supported_capabilities_mutex);
|
|
||||||
g_mutex_init (&self->priv->supported_bands_mutex);
|
|
||||||
g_mutex_init (&self->priv->current_bands_mutex);
|
|
||||||
g_mutex_init (&self->priv->ports_mutex);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -3799,35 +3788,17 @@ finalize (GObject *object)
|
|||||||
{
|
{
|
||||||
MMModem *self = MM_MODEM (object);
|
MMModem *self = MM_MODEM (object);
|
||||||
|
|
||||||
g_mutex_clear (&self->priv->unlock_retries_mutex);
|
g_mutex_clear (&self->priv->mutex);
|
||||||
g_mutex_clear (&self->priv->supported_modes_mutex);
|
|
||||||
g_mutex_clear (&self->priv->supported_capabilities_mutex);
|
|
||||||
g_mutex_clear (&self->priv->supported_bands_mutex);
|
|
||||||
g_mutex_clear (&self->priv->current_bands_mutex);
|
|
||||||
g_mutex_clear (&self->priv->ports_mutex);
|
|
||||||
|
|
||||||
if (self->priv->supported_modes)
|
g_clear_pointer (&self->priv->supported_modes, g_array_unref);
|
||||||
g_array_unref (self->priv->supported_modes);
|
g_clear_pointer (&self->priv->supported_capabilities, g_array_unref);
|
||||||
if (self->priv->supported_capabilities)
|
g_clear_pointer (&self->priv->supported_bands, g_array_unref);
|
||||||
g_array_unref (self->priv->supported_capabilities);
|
g_clear_pointer (&self->priv->current_bands, g_array_unref);
|
||||||
if (self->priv->supported_bands)
|
g_clear_pointer (&self->priv->ports, g_array_unref);
|
||||||
g_array_unref (self->priv->supported_bands);
|
|
||||||
if (self->priv->current_bands)
|
|
||||||
g_array_unref (self->priv->current_bands);
|
|
||||||
if (self->priv->ports)
|
|
||||||
g_array_unref (self->priv->ports);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS (mm_modem_parent_class)->finalize (object);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
dispose (GObject *object)
|
|
||||||
{
|
|
||||||
MMModem *self = MM_MODEM (object);
|
|
||||||
|
|
||||||
g_clear_object (&self->priv->unlock_retries);
|
g_clear_object (&self->priv->unlock_retries);
|
||||||
|
|
||||||
G_OBJECT_CLASS (mm_modem_parent_class)->dispose (object);
|
G_OBJECT_CLASS (mm_modem_parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -3838,6 +3809,5 @@ mm_modem_class_init (MMModemClass *modem_class)
|
|||||||
g_type_class_add_private (object_class, sizeof (MMModemPrivate));
|
g_type_class_add_private (object_class, sizeof (MMModemPrivate));
|
||||||
|
|
||||||
/* Virtual methods */
|
/* Virtual methods */
|
||||||
object_class->dispose = dispose;
|
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user