Commit Graph
13 Commits
Author SHA1 Message Date
Peter Waller 08178d82bd Fix windows build 2014-05-22 07:56:00 +01:00
Peter Waller 16953497ba Eliminate unused imports from windows.go 2014-05-21 19:49:13 +01:00
Peter Waller 537f1d6e40 Make Process.Start the same across platforms 2014-05-21 19:07:05 +01:00
Peter Waller 9fa9adb06d Factor out PlatformSpecificInit() 2014-05-21 19:05:24 +01:00
Peter Waller 708f015f26 Refactor ShellInvocationCommand
This is done because I want to make the *exec.Command shim narrower so
that we can transition to another method for reading Stdout/Stderr to
fix the newline bug described in #16.
2014-05-21 17:59:02 +01:00
Peter Waller 9b422de60d Eliminate p.Running and cross-platform
Now that the process which starts things is responsible for killing
them, it's no longer possible for the *Process to be nil, so the check
is unnecessary and there is no platform difference, so it's moved to
process.go.
2014-05-21 17:26:30 +01:00
Peter Waller 6f180b7482 Move envAsArray from Process onto Env 2014-05-21 17:22:23 +01:00
Peter Waller a5074c5c37 Refactor process shutdown
This is a large change which makes startProcess() responsible for
shutting its own process down, rather than having a global map.

This makes it much easier to reason about who owns what and get the
synchronization right.

The main immediate bugfix is that now we only attempt to send SIGKILL to
processes which haven't yet shut down, making it clearer which processes
are responsible for a delayed shutdown.

It introduces a `teardown` channel which is closed to signal to all
process-monitoring goroutines that they should clean up.

In addition, the platform-specific code has been thinned. Some of the
platform logic moved into the process-monitoring code because it needed
to for now after the introduction of the <-finished barrier.
2014-05-21 09:28:41 +01:00
Peter Waller ca11ca6388 Refactor ShutdownProcess to smaller platform-specific part 2014-05-21 08:44:06 +01:00
Peter Waller 9c2bf670ca Refactor interrupt monitoring and shutdown
This makes it so that the same goroutine responsible for starting
processes shuts them down. This is a stepping stone to a larger refactor
whose goal is to eliminate race conditions.
2014-05-21 08:37:21 +01:00
Jonhnny Weslley b36d1c8980 use build constraints 2013-12-09 00:05:01 -03:00
David Dollar 2a6b13c74d fmt 2013-08-29 21:01:18 -04:00
David Dollar d35a1a300d windows 2013-08-29 20:54:59 -04:00