I'm having a problem with GMutex under Windows that don't lock. The behaviour is definitely different from that under Linux.
The system is composed of to threads. A gui thread G and a worker thread W. The ping pong between the threads via a mutex j->M should work as follows. j is a job data structure that carries info between the worker thread and the gui thread.
Is something supposed to be different under Windows, or should I file a bug?
Thanks!
Dov
The system is composed of to threads. A gui thread G and a worker thread W. The ping pong between the threads via a mutex j->M should work as follows. j is a job data structure that carries info between the worker thread and the gui thread.
- W locks j->M through g_mutex_lock(j->M) so that a subsequent lock will block.
- W fills in j with various info to display.
- W calls g_idle_add(GSourceFunc(cb_update_job), j) to indicate to G that there is info to display.
- W blocks on M through a second call to g_mutex_lock(j->M)
- G is called in cb_update_job() and updates the gui, also possibly updates j, and then does g_mutex_unlock(j->M)
- W wakes up and does a g_mutex_unlock(j->M) as it no longer needs the lock on the mutex.
- W examines the return info that G filled in into j and contiues or aborts its operation.
Is something supposed to be different under Windows, or should I file a bug?
Thanks!
Dov
_______________________________________________ gtk-list mailing list gtk-list@xxxxxxxxx http://mail.gnome.org/mailman/listinfo/gtk-list