aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2001-05-02 01:37:31 +0800
committerDan Winship <danw@src.gnome.org>2001-05-02 01:37:31 +0800
commit4ce894e3ab34ee81967f1d69dfba71eb9f3c0944 (patch)
tree7f9ece319afcf4dc94349b7ba60de003c3d1e9d7
parenteba2691d5dbd944058b5c7645f0ced9bcfee6e72 (diff)
downloadgsoc2013-evolution-4ce894e3ab34ee81967f1d69dfba71eb9f3c0944.tar
gsoc2013-evolution-4ce894e3ab34ee81967f1d69dfba71eb9f3c0944.tar.gz
gsoc2013-evolution-4ce894e3ab34ee81967f1d69dfba71eb9f3c0944.tar.bz2
gsoc2013-evolution-4ce894e3ab34ee81967f1d69dfba71eb9f3c0944.tar.lz
gsoc2013-evolution-4ce894e3ab34ee81967f1d69dfba71eb9f3c0944.tar.xz
gsoc2013-evolution-4ce894e3ab34ee81967f1d69dfba71eb9f3c0944.tar.zst
gsoc2013-evolution-4ce894e3ab34ee81967f1d69dfba71eb9f3c0944.zip
Debugging routine. (Only works for recursive mutexes right now.)
* e-msgport.c (e_mutex_assert_locked): Debugging routine. (Only works for recursive mutexes right now.) svn path=/trunk/; revision=9638
-rw-r--r--e-util/ChangeLog3
-rw-r--r--e-util/e-msgport.c8
-rw-r--r--e-util/e-msgport.h1
3 files changed, 12 insertions, 0 deletions
diff --git a/e-util/ChangeLog b/e-util/ChangeLog
index 027717987e..ab679f24f4 100644
--- a/e-util/ChangeLog
+++ b/e-util/ChangeLog
@@ -1,5 +1,8 @@
2001-05-01 Dan Winship <danw@ximian.com>
+ * e-msgport.c (e_mutex_assert_locked): Debugging routine. (Only
+ works for recursive mutexes right now.)
+
* e-html-utils.c (e_text_to_html_full): Don't use g_utf8_next_char
on text that isn't valid UTF8, since it won't work (and might even
get into an infinite loop).
diff --git a/e-util/e-msgport.c b/e-util/e-msgport.c
index 683aa85d78..d034f0deaf 100644
--- a/e-util/e-msgport.c
+++ b/e-util/e-msgport.c
@@ -758,6 +758,14 @@ int e_mutex_unlock(EMutex *m)
return -1;
}
+void e_mutex_assert_locked(EMutex *m)
+{
+ g_return_if_fail (m->type == E_MUTEX_REC);
+ pthread_mutex_lock(&m->mutex);
+ g_assert(m->owner == pthread_self());
+ pthread_mutex_unlock(&m->mutex);
+}
+
#ifdef STANDALONE
EMsgPort *server_port;
diff --git a/e-util/e-msgport.h b/e-util/e-msgport.h
index 6e25235bbd..d181ac7fb7 100644
--- a/e-util/e-msgport.h
+++ b/e-util/e-msgport.h
@@ -77,5 +77,6 @@ EMutex *e_mutex_new(e_mutex_t type);
int e_mutex_destroy(EMutex *m);
int e_mutex_lock(EMutex *m);
int e_mutex_unlock(EMutex *m);
+void e_mutex_assert_locked(EMutex *m);
#endif