patch for async TCP sockets. without this change the callbacks will
authorGreg Young <gregoryyoung1@gmail.com>
Wed, 19 Sep 2012 13:29:16 +0000 (16:29 +0300)
committerGreg Young <gregoryyoung1@gmail.com>
Wed, 19 Sep 2012 13:29:16 +0000 (16:29 +0300)
occasionally not happen under load. This causes the async loop
to break in the calling TCP code. EX you call beginsend but
never get endsend

mono/metadata/threadpool.c

index ad2b3de06a0e155fe9558b6f2cd67bcba1f5f273..1eb527e00fc72013b136c9e4660051d0580fb778 100644 (file)
@@ -574,8 +574,8 @@ socket_io_add (MonoAsyncResult *ares, MonoSocketAsyncResult *state)
 
        mono_g_hash_table_replace (data->sock_to_state, state->handle, list);
        ievt = get_events_from_list (list);
-       LeaveCriticalSection (&data->io_lock);
        data->modify (data->event_data, fd, state->operation, ievt, is_new);
+        LeaveCriticalSection (&data->io_lock);
 }
 
 #ifndef DISABLE_SOCKETS