In many cases, the Mutexes and Monitors have to be marked "mutable"
because they're used to synchronize const accessor methods.
Small text segment improvement for Product builds:
$ size dart.{arm,x64}.{before,after}
text data bss dec hex filename
19726069 409960 392332 20528361 1393ce9 dart.arm.before
19725525 409960 392332 20527817 1393ac9 dart.arm.after
22576021 600376 1782824 24959221 17cd8f5 dart.x64.before
22574821 600376 1782824 24958021 17cd445 dart.x64.after
Change-Id: I68f5cd5ad452044df8bfebd160910496036a3e6b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101745
Commit-Queue: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
If an Isolate touches the 'stdio' getter, a _NativeSocket with
attached finalizer is created for it. Previously, when such an
Isolate exited, the finalizer would close the underlying
file descriptor. This CL changes the finalizer for stdin such
that the native objects will be cleaned up, but the underlying
file descriptor will not be closed. The underlying file
descriptor will now only be closed if the stdin stream
subscription is explicitly canceled.
Accessing the stdin getter after the stream is explicitly
canceled will result in a FileSystemException.
See also: https://github.com/dart-lang/test/issues/583fixes#29229R=rmacnak@google.com
Review-Url: https://codereview.chromium.org/2791423002 .
The finalizer sends the "close" message to the EventHandler for the
file descriptor in the _NativeSocket's native field. To avoid races and
spurious messages, this CL stores a pointer to a wrapper object in the
native field instead of the file descriptor. All messsages about the
_NativeSocket sent to the EventHandler use the wrapper object instead of
the file descriptor. When the EventHandler closes the file, the file
descriptor in the wrapper object is set to -1 so that the finalizer will
instead do nothing.
On Windows, there is another level of indirection since the OS HANDLEs
were already wrapped in various kinds of Handle objects. As an additional
complication, ClientSocket close on Windows is asynchronous, so the
EventHandler may shutdown before all of the ClientSocket Handles can be
destroyed.
related #27898, #28081R=johnmccutchan@google.com
Review-Url: https://codereview.chromium.org/2760293002 .
i.e. #ifndef VM_WHATEVER -> #ifndef RUNTIME_VM_WHATEVER
This lets us remove a hack from the PRESUBMIT.py script that existed
for reasons that are no longer valid, and sets us up to add some
presubmit checks for the GN build.
R=asiva@google.com, rmacnak@google.com
Review URL: https://codereview.chromium.org/2450713004 .
These threads are polluting the exit code despite using the better
ExitProcess call. Instead of adding back Thread::Join, I've instead
inlined the call into the eventhandler to make it easier to be sure
the open handles are closed.
R=johnmccutchan@google.com
Review URL: https://codereview.chromium.org/1989463003 .
Initial implementation of UDP support in dart:io
Added a RawDatagramSocket which gets the same events as a RawSocket
except that READ_CLOSED is never received.
The receive from a RawDatagramSocket returns a Datagram object where
the senders address and port is presten together with the data.
The send on a RawDatagramSocket takes data and the address and port of
the destination.
Extended the number of socket options to support UDP.
Added getting the socket options.
R=ajohnsen@google.com
BUG=http://dartbug.com/1975
Review URL: https://codereview.chromium.org//85993002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31098 260f80e4-7a28-3924-810f-c04153c831b5
1. Improve error handling in Windows event handler
Whenever an error happens on an IO operation this
generates an error event and the handle is marked as having has
an error.
The test http_shutdown_test have been fixed to check for error as well
as succesful request when the server is closing the connection due to
closing the output stream before the input have been read. The test
have also been extended to have the client send more request data to
get more errors.
2. Disable event handler events until re-enabled from Dart
When an eventhandle event is posted to Dart this event is now
disabled in the eventhandler until re-enabled from Dart.
On Linux and Mac OS this was already the case as the file
descriptor for which the event(s) was posted was removed from
epoll/kqueue when events was posted.
On Windows this is now changed so that after an event is posted
it needs to be re-enabled from Dart code like on Linux and Mac
OS.
Changed the Dart event handler code to avoid posting disabling of
the out handler as the C++ code is already doing this on all
platforms.
3. Cancel HTTP parser when a connection is closing
When a HTTP connection is closing and moved to the close queue
there should be no more envents from the HTTP parser for whatever
data is still buffered.
R=ager@google.com
BUG=7294
Review URL: https://codereview.chromium.org//11623004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16252 260f80e4-7a28-3924-810f-c04153c831b5
There are currently no tests of the error handling, as it is hard to
create consistent tests. I have done some manual tests locally:
* Lowering the number of file descriptors available (ulimit -n) and hitting that limit
* Running two dart programs communicating and terminating one (using Ctrl-C)
* Running two dart programs communicating on two machines and pulling out the network cable.
If there is an error we always call the onError callback and never the onClosed callback.
On Windows there is the issue that both closing the connection correctly and terminating one end gives the same error (ERROR_NETNAME_DELETED) so both are reported as connection close. Pulling out the network cable gives a different (real) error on Windows though.
On Mac OS it turned out the for kqueue EV_EOF is also used to indicate errors with the error code set in the fflags field. EV_ERROR is only reported if there is an internal error in kevent processing (see http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man2/kqueue.2.html).
R=ager@google.com
BUG=
TEST=
Review URL: https://chromiumcodereview.appspot.com//9720045
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5709 260f80e4-7a28-3924-810f-c04153c831b5