37499dce81
- Use only one thread to wait for multiple process objects. - Fix issue where reading from a closed pipe would print an error message on stderr. - Remove the need to go to dart before removing a processinfo object from the list. Sometimes you never get there so we have to remove the process info object always. BUG= TEST= Review URL: https://chromiumcodereview.appspot.com//9310053 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3844 260f80e4-7a28-3924-810f-c04153c831b5
40 lines
1.2 KiB
C++
40 lines
1.2 KiB
C++
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
#ifndef BIN_PROCESS_H_
|
|
#define BIN_PROCESS_H_
|
|
|
|
#include "bin/builtin.h"
|
|
#include "platform/globals.h"
|
|
|
|
|
|
class Process {
|
|
public:
|
|
// Start a new process providing access to stdin, stdout, stderr and
|
|
// process exit streams.
|
|
static int Start(const char* path,
|
|
char* arguments[],
|
|
intptr_t arguments_length,
|
|
const char* working_directory,
|
|
intptr_t* in,
|
|
intptr_t* out,
|
|
intptr_t* err,
|
|
intptr_t* id,
|
|
intptr_t* exit_handler,
|
|
char* os_error_message,
|
|
int os_error_message_len);
|
|
|
|
// Kill a process with a given pid.
|
|
static bool Kill(intptr_t id);
|
|
|
|
// Terminate the exit code handler thread. Does not return before
|
|
// the thread has terminated.
|
|
static void TerminateExitCodeHandler();
|
|
|
|
DISALLOW_ALLOCATION();
|
|
DISALLOW_IMPLICIT_CONSTRUCTORS(Process);
|
|
};
|
|
|
|
#endif // BIN_PROCESS_H_
|