signals and threads



Hi!

I develop the app, that needs to run 2 same windows, each in separate thread.
I have a same signal handlers in each thread. The difference is only in thread
specific data, because i need to make a different things in different threads.
Example:
...
g_signal_connect(G_OBJECT(app->text_buffer_my), "insert-text",
                    G_CALLBACK(on_tb_insert_text), NULL);
...                 
g_print("tid: %p app->text_buffer_my: %p\n", pthread_self(),
  app->text_buffer_my);
...

Output:
tid: 0x8003 app->text_buffer_my: 0xb661ec18
tid: 0x4002 app->text_buffer_my: 0xb6627e40

But i have a problem with signal handlers. Only signal handler from
0x8003(registered 1st) thread invoked(for both buffers). But i need to handle
0x4002's "insert-text" with 0x4002 signal handler(to access thread specific
data and handle input properly). How can i resolve a problem?






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]