Possible deadlock fixed, thanks Henrik for reporting it.
This commit is contained in:
parent
220f49f206
commit
8ba49be856
@ -1,3 +1,8 @@
|
|||||||
|
2009-08-13 Frederic Culot <frederic@culot.org>
|
||||||
|
|
||||||
|
* src/notify.c (notify_thread_app): possible deadlock fixed
|
||||||
|
(thanks Henrik for reporting it)
|
||||||
|
|
||||||
2009-08-09 Frederic Culot <frederic@culot.org>
|
2009-08-09 Frederic Culot <frederic@culot.org>
|
||||||
|
|
||||||
* src/notify.c (notify_thread_app): rewritten
|
* src/notify.c (notify_thread_app): rewritten
|
||||||
|
10
src/notify.c
10
src/notify.c
@ -1,4 +1,4 @@
|
|||||||
/* $calcurse: notify.c,v 1.45 2009/08/09 15:34:56 culot Exp $ */
|
/* $calcurse: notify.c,v 1.46 2009/08/13 17:30:42 culot Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Calcurse - text-based organizer
|
* Calcurse - text-based organizer
|
||||||
@ -429,17 +429,21 @@ notify_thread_app (void *arg)
|
|||||||
if (!notify_get_next (&tmp_app))
|
if (!notify_get_next (&tmp_app))
|
||||||
pthread_exit ((void *)0);
|
pthread_exit ((void *)0);
|
||||||
|
|
||||||
pthread_mutex_lock (¬ify_app.mutex);
|
|
||||||
if (!tmp_app.got_app)
|
if (!tmp_app.got_app)
|
||||||
{
|
{
|
||||||
|
pthread_mutex_lock (¬ify_app.mutex);
|
||||||
notify_free_app ();
|
notify_free_app ();
|
||||||
|
pthread_mutex_unlock (¬ify_app.mutex);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!notify_same_item (tmp_app.time))
|
if (!notify_same_item (tmp_app.time))
|
||||||
|
{
|
||||||
|
pthread_mutex_lock (¬ify_app.mutex);
|
||||||
notify_update_app (tmp_app.time, tmp_app.state, tmp_app.txt);
|
notify_update_app (tmp_app.time, tmp_app.state, tmp_app.txt);
|
||||||
}
|
|
||||||
pthread_mutex_unlock (¬ify_app.mutex);
|
pthread_mutex_unlock (¬ify_app.mutex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (tmp_app.txt)
|
if (tmp_app.txt)
|
||||||
mem_free (tmp_app.txt);
|
mem_free (tmp_app.txt);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user