aboutsummaryrefslogtreecommitdiffstats
path: root/shell/main.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2010-04-15 20:43:20 +0800
committerMilan Crha <mcrha@redhat.com>2010-04-15 20:43:20 +0800
commit200f6ec5e4d4aa45589a381acd42651fd54cecc3 (patch)
treed468aee92819507d8f8cea1a664012cdee0d24ee /shell/main.c
parent4b4fce32b7005d14d601ea2c600d8a3ae095a1fc (diff)
downloadgsoc2013-evolution-200f6ec5e4d4aa45589a381acd42651fd54cecc3.tar
gsoc2013-evolution-200f6ec5e4d4aa45589a381acd42651fd54cecc3.tar.gz
gsoc2013-evolution-200f6ec5e4d4aa45589a381acd42651fd54cecc3.tar.bz2
gsoc2013-evolution-200f6ec5e4d4aa45589a381acd42651fd54cecc3.tar.lz
gsoc2013-evolution-200f6ec5e4d4aa45589a381acd42651fd54cecc3.tar.xz
gsoc2013-evolution-200f6ec5e4d4aa45589a381acd42651fd54cecc3.tar.zst
gsoc2013-evolution-200f6ec5e4d4aa45589a381acd42651fd54cecc3.zip
Bug #608766 - Replace pthread with GLib's GThread
Diffstat (limited to 'shell/main.c')
-rw-r--r--shell/main.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/shell/main.c b/shell/main.c
index c36afc6d1a..eba992e193 100644
--- a/shell/main.c
+++ b/shell/main.c
@@ -251,18 +251,16 @@ idle_cb (gchar **uris)
static void (*gnome_segv_handler) (gint);
static GStaticMutex segv_mutex = G_STATIC_MUTEX_INIT;
-static pthread_t main_thread;
+static GThread *main_thread = NULL;
static void
segv_redirect (gint sig)
{
- if (pthread_self () == main_thread)
- gnome_segv_handler (sig);
- else {
- pthread_kill (main_thread, sig);
+ gnome_segv_handler (sig);
+ if (g_thread_self () != main_thread) {
/* We can't return from the signal handler or the thread may
- SEGV again. But we can't pthread_exit, because then the
+ SEGV again. But we can't g_thread_exit, because then the
thread may get cleaned up before bug-buddy can get a stack
trace. So we block by trying to lock a mutex we know is
already locked. */
@@ -279,7 +277,7 @@ setup_segv_redirect (void)
if (osa.sa_handler == SIG_DFL)
return;
- main_thread = pthread_self ();
+ main_thread = g_thread_self ();
sa.sa_flags = 0;
sigemptyset (&sa.sa_mask);