Commit 48aace18 authored by Max Kellermann's avatar Max Kellermann

event_pipe: moved variable "main_task" to main.c

parent 96814397
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#include <glib.h> #include <glib.h>
#include <string.h> #include <string.h>
GThread *main_task;
static int event_pipe[2]; static int event_pipe[2];
static GMutex *event_pipe_mutex; static GMutex *event_pipe_mutex;
static bool pipe_events[PIPE_EVENT_MAX]; static bool pipe_events[PIPE_EVENT_MAX];
...@@ -78,8 +77,6 @@ void event_pipe_init(void) ...@@ -78,8 +77,6 @@ void event_pipe_init(void)
{ {
GIOChannel *channel; GIOChannel *channel;
main_task = g_thread_self();
if (pipe(event_pipe) < 0) if (pipe(event_pipe) < 0)
g_error("Couldn't open pipe: %s", strerror(errno)); g_error("Couldn't open pipe: %s", strerror(errno));
if (set_nonblocking(event_pipe[1]) < 0) if (set_nonblocking(event_pipe[1]) < 0)
...@@ -90,8 +87,6 @@ void event_pipe_init(void) ...@@ -90,8 +87,6 @@ void event_pipe_init(void)
g_io_channel_unref(channel); g_io_channel_unref(channel);
event_pipe_mutex = g_mutex_new(); event_pipe_mutex = g_mutex_new();
main_task = g_thread_self();
} }
void event_pipe_deinit(void) void event_pipe_deinit(void)
......
...@@ -44,8 +44,6 @@ enum pipe_event { ...@@ -44,8 +44,6 @@ enum pipe_event {
typedef void (*event_pipe_callback_t)(void); typedef void (*event_pipe_callback_t)(void);
extern GThread *main_task;
void event_pipe_init(void); void event_pipe_init(void);
void event_pipe_deinit(void); void event_pipe_deinit(void);
......
...@@ -76,6 +76,7 @@ ...@@ -76,6 +76,7 @@
#include <locale.h> #include <locale.h>
#endif #endif
GThread *main_task;
GMainLoop *main_loop; GMainLoop *main_loop;
struct notify main_notify; struct notify main_notify;
...@@ -242,6 +243,7 @@ int main(int argc, char *argv[]) ...@@ -242,6 +243,7 @@ int main(int argc, char *argv[])
changeToUser(); changeToUser();
main_task = g_thread_self();
main_loop = g_main_loop_new(NULL, FALSE); main_loop = g_main_loop_new(NULL, FALSE);
notify_init(&main_notify); notify_init(&main_notify);
......
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
#include <glib.h> #include <glib.h>
extern GThread *main_task;
extern GMainLoop *main_loop; extern GMainLoop *main_loop;
extern struct notify main_notify; extern struct notify main_notify;
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include "update.h" #include "update.h"
#include "idle.h" #include "idle.h"
#include "conf.h" #include "conf.h"
#include "main.h"
#include <glib.h> #include <glib.h>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment