Multithreading trouble



Hi,

I wrote a mutlithreaded program which occasionally hangs. Here's an
outline of its widgets and what they do:

[StartButton] Starts a thread with pthread_create. The thread performes
              a calculation and updates [SomeWidgets] from time to time 
              by calling the function
                  updateWidgets() {
                      gdk_threads_enter();
                      ...
                      update [SomeWidgets]
                      ...
                      gdk_threads_leave();
                  }
[QuitButton]  Quits the program by setting a flag that causes the
              thread to terminate itself.
[SomeWidgets]

Now, my problem is that when I press [QuitButton] while updateWidgets()
is running the program hangs. What am I doing wrong?

TIA,

Felix




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