Change to wait for all outstanding iothreads before calling fork(). This should prevent a whole host of threading/fork interactions, but may also compromise performance...we'll see.

This commit is contained in:
ridiculousfish
2012-02-27 19:46:15 -08:00
parent fdfa5c0602
commit cf54ad8242
3 changed files with 44 additions and 38 deletions

View File

@@ -34,6 +34,7 @@
#include "fallback.h"
#include "util.h"
#include "iothread.h"
#include "common.h"
#include "wutil.h"
@@ -833,6 +834,9 @@ static pid_t exec_fork()
{
ASSERT_IS_MAIN_THREAD();
/* Make sure we have no outstanding threads before we fork. This is a pretty sketchy thing to do here, both because exec.cpp shouldn't have to know about iothreads, and because the completion handlers may do unexpected things. */
iothread_drain_all();
pid_t pid;
struct timespec pollint;
int i;