diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2012-02-27 19:46:15 -0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2012-02-27 19:46:15 -0800 |
commit | cf54ad8242056ae6d686fa6455b24427f4411e18 (patch) | |
tree | a1cc4a8bec1d1688114a19b07a1b29e6b7f9b361 /exec.cpp | |
parent | fdfa5c06028d3473f57cea497a6682a8e550352f (diff) |
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.
Diffstat (limited to 'exec.cpp')
-rw-r--r-- | exec.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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; |