diff options
author | Lennart Poettering <lennart@poettering.net> | 2005-10-16 14:26:53 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2005-10-16 14:26:53 +0000 |
commit | f03a9fad41c07d68c692e7d53cd9c1fe374f33bc (patch) | |
tree | 4d56df1e81b906744239d37c75de1a959087a4c8 /avahi-compat-howl | |
parent | 9da0241b9c1bf751605ba11fa6d4c75e34fe5f2b (diff) |
* add a seperate mutex for salt_lock()/salt_unlock() so that it doesn't interfere with our internal locking
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@788 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-compat-howl')
-rw-r--r-- | avahi-compat-howl/compat.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/avahi-compat-howl/compat.c b/avahi-compat-howl/compat.c index 120f81b..d9a1bda 100644 --- a/avahi-compat-howl/compat.c +++ b/avahi-compat-howl/compat.c @@ -88,7 +88,7 @@ struct _sw_discovery { pthread_t thread; int thread_running; - pthread_mutex_t mutex; + pthread_mutex_t mutex, salt_mutex; AVAHI_LLIST_HEAD(service_data, services); }; @@ -370,6 +370,7 @@ sw_result sw_discovery_init(sw_discovery * self) { ASSERT_SUCCESS(pthread_mutexattr_init(&mutex_attr)); pthread_mutexattr_settype(&mutex_attr, PTHREAD_MUTEX_RECURSIVE); ASSERT_SUCCESS(pthread_mutex_init(&(*self)->mutex, &mutex_attr)); + ASSERT_SUCCESS(pthread_mutex_init(&(*self)->salt_mutex, &mutex_attr)); if (!((*self)->simple_poll = avahi_simple_poll_new())) goto fail; @@ -451,6 +452,7 @@ static void discovery_unref(sw_discovery self) { close(self->main_fd); ASSERT_SUCCESS(pthread_mutex_destroy(&self->mutex)); + ASSERT_SUCCESS(pthread_mutex_destroy(&self->salt_mutex)); while (self->services) service_data_free(self, self->services); @@ -610,7 +612,7 @@ sw_result sw_salt_lock(sw_salt self) { AVAHI_WARN_LINKAGE; assert(self); - ASSERT_SUCCESS(pthread_mutex_lock(&((sw_discovery) self)->mutex)); + ASSERT_SUCCESS(pthread_mutex_lock(&((sw_discovery) self)->salt_mutex)); return SW_OKAY; } @@ -620,7 +622,7 @@ sw_result sw_salt_unlock(sw_salt self) { AVAHI_WARN_LINKAGE; - ASSERT_SUCCESS(pthread_mutex_unlock(&((sw_discovery) self)->mutex)); + ASSERT_SUCCESS(pthread_mutex_unlock(&((sw_discovery) self)->salt_mutex)); return SW_OKAY; } |