diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2008-07-03 13:32:11 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2008-07-03 13:32:11 +0200 |
commit | dd1ef7a7020ce9a32c55476e3e9a5587b141537b (patch) | |
tree | e43c27056106fa714fe5fda5b2d195df92396c05 /include | |
parent | c6af8b38102a9d53be5fa7a25b4374e4a9f3f4b4 (diff) | |
download | connman-dd1ef7a7020ce9a32c55476e3e9a5587b141537b.tar.gz connman-dd1ef7a7020ce9a32c55476e3e9a5587b141537b.tar.bz2 connman-dd1ef7a7020ce9a32c55476e3e9a5587b141537b.zip |
Simplify the locking and remove some deadlocks
Diffstat (limited to 'include')
-rw-r--r-- | include/element.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/element.h b/include/element.h index af34da8d..c4d97cc2 100644 --- a/include/element.h +++ b/include/element.h @@ -66,6 +66,7 @@ struct connman_driver; struct connman_element { gint refcount; + GStaticMutex mutex; gchar *name; gchar *path; enum connman_element_type type; @@ -96,6 +97,9 @@ struct connman_element { } ipv4; }; +#define connman_element_lock(element) g_static_mutex_lock(&(element)->mutex) +#define connman_element_unlock(element) g_static_mutex_unlock(&(element)->mutex) + extern struct connman_element *connman_element_create(void); extern struct connman_element *connman_element_ref(struct connman_element *element); extern void connman_element_unref(struct connman_element *element); |