blob: 1e40b80f01b8d53660b5a9ee612b69e2bbd2140e [file] [log] [blame]
/*
* Copyright (c) 2011, 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.
*/
/**
* @assertion abstract void close()
* If the stream has already been canceled this method has no effect.
* @description Checks multiple invocation of [close].
* @author kaigorodov
* @author a.semenov@unipro.ru
*/
import 'dart:async';
import "dart:isolate";
import "../../../Utils/expect.dart";
void iMain(SendPort replyPort) {
replyPort.send("message");
}
main() {
asyncStart();
ReceivePort receivePort = new ReceivePort();
var sendPort = receivePort.sendPort;
Future.wait([Isolate.spawn(iMain, sendPort), receivePort.first])
.then((v) => receivePort.close())
.then((v) => receivePort.close())
.then((v) => receivePort.close())
.then((v) => asyncEnd());
}