aboutsummaryrefslogtreecommitdiffhomepage
path: root/exec.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-02-27 18:43:24 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-02-27 18:43:24 -0800
commitfdfa5c06028d3473f57cea497a6682a8e550352f (patch)
treef822ccc211dd331c2b0d99949d0e4288fded0eef /exec.cpp
parent50ee5d28cdc5b521f2d2feda264ec798e8f3ab8e (diff)
Some initial work towards resolving nasty fork/pthread issues, and to having a per-parser job list
Diffstat (limited to 'exec.cpp')
-rw-r--r--exec.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/exec.cpp b/exec.cpp
index 3de094b9..85a3696a 100644
--- a/exec.cpp
+++ b/exec.cpp
@@ -831,6 +831,8 @@ static int set_child_group( job_t *j, process_t *p, int print_errors )
*/
static pid_t exec_fork()
{
+ ASSERT_IS_MAIN_THREAD();
+
pid_t pid;
struct timespec pollint;
int i;
@@ -1047,6 +1049,7 @@ void exec( parser_t &parser, job_t *j )
if( keepalive.pid == 0 )
{
+ /* Child */
keepalive.pid = getpid();
set_child_group( j, &keepalive, 1 );
pause();
@@ -1054,6 +1057,7 @@ void exec( parser_t &parser, job_t *j )
}
else
{
+ /* Parent */
set_child_group( j, &keepalive, 0 );
}
}