From 41a44f79ee1e559257fb6b2c88e1eb140fe657bf Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 3 Oct 2008 15:16:33 -0700 Subject: 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. --- src/main_notify.c | 3 +++ src/main_notify.h | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/src/main_notify.c b/src/main_notify.c index 2c546633d..04ceac62d 100644 --- a/src/main_notify.c +++ b/src/main_notify.c @@ -24,6 +24,8 @@ #include "gcc.h" #include "log.h" +pthread_t main_task; + static struct ioOps main_notify_IO; static int main_pipe[2]; @@ -55,6 +57,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 db36042a7..dc743b833 100644 --- a/src/main_notify.h +++ b/src/main_notify.h @@ -21,6 +21,10 @@ #ifndef MAIN_NOTIFY_H #define MAIN_NOTIFY_H +#include + +extern pthread_t main_task; + void init_main_notify(void); void wakeup_main_task(void); -- cgit v1.2.3