Locking is hard A possible design: - Every object has its own lock - No more than one lock can be taken by the same thread at a time. + Is a checkable invariant. A wrapper around g_mutex_lock() can be written that checks it. - Draconican Rules: - whenever you call a callback or a method on another object: - first make a copy of all the state yuo wish to pass - then unlock - then call and store the return value on the stack - then lock - then do something with the return value. And at this point be aware that other threads could have changed you.