Pthreads messes up interface

I run my gtk_main() in a normal pthread which works 
just fine. But when i from that thread try to start 
another (default) pthread that does stuff that affects 
the interface it won't redraw properly.
The code is kind of like this:

//(this is gtk_main pthread)
pthread_t my_new_thread;

void start_auto(GtkToggleButton  *tb, gpointer ud){
  pthread_create(&my_new_thread, NULL, auto_update, 

void auto_update(){
  while(var == 1){ //variable will be changed from other
     do_stuff(); //stuff will emitt signals that
                 //affect user interface in
                 //gtk_main pthread.

What am I doing wrong?

Thx /Mattias

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