minor fix for bug 9520:
- socket configuration attempts to determine if system supports ipv6
- checks app configuration, but configuration throws exception if called from embedded context
- solution is to put a try/catch guard and fall to an alternative test for ipv6
Added MONO_API macro to annotate and control visibility of public (exported) APIs.

This is especially useful for Windows since this way there is no need to maintain a separate .def file with exports which is usually out-of-sync with the latest revisions. This could also be used to control visibility with GCC/Clang so there would be no need for MONO_INTERNAL (could be removed while changing the default visibility to hidden).
Improve detecting if a handle is a console on Windows.

Use GetConsoleMode. If it succeeds (returns non-zero) then the handle is a
console. If it fails (returns zero) then the handle is not a console.

The old check, (GetFileType (handle) == FILE_TYPE_CHAR) assumes that a handle
of type FILE_TYPE_CHAR is a console. This falsely reports a handle directed to
NUL as a console.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=12752
Add TimeZoneInfo Serialization

Add serialization for the TimeZoneInfo, TimeZoneInfo.AdjustmentRule and TimeZoneInfo.TransitionTime class. It is compatible with the serialization in .Net for cross serialization/deserialization from Mono to .Net and vice versa.

The code in this commit is released under the terms of the MIT/X11 license.
Call 'awk' instead of 'gawk' for cross-platform compatibility.

Call `awk` instead of `gawk` for cross-platform compatibility. Linux systems normally have a symbolic link from `awk` to `gawk`, so there should be no difference in the functionality on those systems.
Revert "Merge pull request #622 from killabytenow/master"

This reverts commit 392bae3c453763e8f887f447678ab0202a36228a, reversing
changes made to 61cd9ee8b63bdd34fd3b5ebd58f2de3fce507a61.
Merge pull request #700 from jack-pappas/patch-1

Call 'awk' instead of 'gawk' for cross-platform compatibility.
There was a long discussion on a mailing list about the async-socket problem
in mono. We have previously submitted a patch fixing the problem, however it
was later reverted back as causing deadlocks in some cases.

This patch is very close to the original one, but it takes into account how
tpool-thread operates and avoids deadlocks in this code. (Unfortunately, it
probably makes the code a little less readable, but it works).

So, this patch aims to fix several races in the mono code. These problems are
not relevant for a lot of applications as they can appear only if both read
and write operations are active on the socket. (I.e. RPC style communications
do not trigger the problem).

So, there are two major problems with existing mono code:

a) threadpool.c :: socket_io_add

LeaveCriticalSection (&data->io_lock);
data->modify (data->event_data, fd, state->operation, ievt, is_new);

the problem is that data modify receives ievt and is_new arguments which
may be already outdated due to the concurrent operation on the same socket
(read vs. write).

(If you look at the other part of the operation in
tpool_epoll.c :: tp_epoll_wait updates the epoll settigs under the lock.)

b) The epoll implementation uses the following code to change the epoll
settings in the data->modify handler.

if (epoll_ctl (data->epollfd, epoll_op, fd, &evt) == -1) {
  int err = errno;
  if (epoll_op == EPOLL_CTL_ADD && err == EEXIST) {
    epoll_op = EPOLL_CTL_MOD;
    if (epoll_ctl (data->epollfd, epoll_op, fd, &evt) == -1) {
      g_message ("epoll_ctl(MOD): %d %s", err, g_strerror (err));
    }
  }
}

Here we have the same problem. If concurrent operation updates epoll between
first epoll_ctl and the second epoll_ctl the second will override concurrent
update.

These problems result in missing callbacks on async socket send or receive
completion

The original idea was as simple as just move the data->modify under the lock.
(NOTE: both internal associated list and epoll are updated under the lock in
case of data->wait (see tp_epoll_wait).

As i already noted it causes a problem for tpool_poll.c implementation as it
uses different approach than epoll/kqueue.

This patch still invokes data->modify under the lock, but allow implementation
to release lock at the point where it is appropriate for the given
implementation.

The tpool-poll.c releases lock immediately and thus its behavior remains
unchanged (and it still has a problem of missing send/receive callbacks)

The tpool-epoll/kqueue implementations update their internal structures and
corresponding OS level structures under the locks (as _wait does). This change
makes them reliable in simultaneous socket read/write scenarios.

The following code demonstrates the problem. See readme inside.

https://github.com/ysw/mono-socket-problem/tree/master/SocketTest

NOTE: you need at least 4 coresto reliably reproduce the problem.

It is quite hard to reproduce on OSX, but it is easy reproducible in LINUX.

This commit is licensed under MIT/X11.
Implement webrequest cancellation. Fixes #13200
Fix gshared synchronized wrappers for static methods.
Remove test-sgen from make check in tests/, it takes too much time.
Avoid using dmb/dsb/dib instructions on ARM v6.

This only worked by accident before the HAVE_ARMV<N>
changes because __ARM_ARCH_6__ is never defined by
any compiler.
Bump master version to 3.3.0.
[runtime] Add a fallback on the TLS probing code that does a range scan in the pthread structure.
Put the unbox_trampolines table into the .text segment instead of .rodata on mt since it contains code.
Escape the .file path name generated in the asembly code. clang does not mind, but gcc does
Fix synchronized_generic_cache.
Make wrappers whose signature is static static.
Avoid an assert in mono_save_seq_point_info () if no seq points are generated for a method, as in wrappers in android. Hopefully fixes #12995.
Fixes scheduling of non-inlined sychronous continuations.