Cole Robinson cd0ef0e09b Fix log locking problem when using fork() in the library
Ad pointed out by Dan Berrange:
So if some thread in libvirtd is currently executing a logging call,
while another thread calls virExec(), that other thread no longer
exists in the child, but its lock is never released. So when the
child then does virLogReset() it deadlocks.

The only way I see to address this, is for the parent process to call
virLogLock(), immediately before fork(), and then virLogUnlock()
afterwards in both parent & child. This will ensure that no other
thread
can be holding the lock across fork().

* src/util/logging.[ch] src/libvirt_private.syms: export virLogLock() and
  virLogUnlock()
* src/util/util.c: lock just before forking and unlock just after - in
  both parent and child.
2010-02-03 17:12:57 +01:00
..
2009-09-22 20:10:00 +02:00
2009-10-07 15:26:23 +02:00
2009-11-03 23:44:48 +01:00
2010-02-01 09:39:54 -05:00
2010-01-27 08:10:06 +01:00
2010-01-21 15:32:37 +01:00
2009-10-22 10:33:52 +02:00