From 4ce894e3ab34ee81967f1d69dfba71eb9f3c0944 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Tue, 1 May 2001 17:37:31 +0000 Subject: 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 --- e-util/ChangeLog | 3 +++ e-util/e-msgport.c | 8 ++++++++ e-util/e-msgport.h | 1 + 3 files changed, 12 insertions(+) (limited to 'e-util') 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 + * 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 -- cgit v1.2.3