aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2008-10-06 18:31:59 +0200
committerMax Kellermann <max@duempel.org>2008-10-06 18:31:59 +0200
commit700f18eee55cd6a5906bd526f62e958647cea221 (patch)
tree1167532d758050ba3acfb9ee2026b6350a005af0
parent19a4803bc926efa8c61f0e1b47cc8eb76d10bc96 (diff)
downloadmpd-700f18eee55cd6a5906bd526f62e958647cea221.tar.gz
mpd-700f18eee55cd6a5906bd526f62e958647cea221.tar.xz
mpd-700f18eee55cd6a5906bd526f62e958647cea221.zip
main_notify: define main_task so we can use it for assertions
It'll be easier to keep track of what code runs in what task/thread this way.
-rw-r--r--src/main_notify.c3
-rw-r--r--src/main_notify.h4
2 files changed, 6 insertions, 1 deletions
diff --git a/src/main_notify.c b/src/main_notify.c
index 96fb374b5..996b750cf 100644
--- a/src/main_notify.c
+++ b/src/main_notify.c
@@ -27,7 +27,7 @@
static struct ioOps main_notify_IO;
static int main_pipe[2];
-static pthread_t main_task;
+pthread_t main_task;
static Notify main_notify;
static pthread_mutex_t select_mutex = PTHREAD_MUTEX_INITIALIZER;
@@ -60,6 +60,7 @@ static int ioops_consume(int fd_count, fd_set * rfds,
void init_main_notify(void)
{
+ main_task = pthread_self();
init_async_pipe(main_pipe);
main_notify_IO.fdset = ioops_fdset;
main_notify_IO.consume = ioops_consume;
diff --git a/src/main_notify.h b/src/main_notify.h
index dd30dc5d6..aaa1f20b4 100644
--- a/src/main_notify.h
+++ b/src/main_notify.h
@@ -21,6 +21,10 @@
#ifndef MAIN_NOTIFY_H
#define MAIN_NOTIFY_H
+#include <pthread.h>
+
+extern pthread_t main_task;
+
void init_main_notify(void);
void deinit_main_notify(void);