static gint64 last_keepalive;
gint64 msecs;
- MONO_PREPARE_BLOCKING;
+ MONO_ENTER_GC_SAFE;
do {
again:
}
} while ((res > 0 && total < len) || (res == -1 && get_last_sock_error () == MONO_EINTR));
- MONO_FINISH_BLOCKING;
+ MONO_EXIT_GC_SAFE;
return total;
}
static int
socket_transport_accept (int socket_fd)
{
- MONO_PREPARE_BLOCKING;
+ MONO_ENTER_GC_SAFE;
conn_fd = accept (socket_fd, NULL, NULL);
- MONO_FINISH_BLOCKING;
+ MONO_EXIT_GC_SAFE;
if (conn_fd == -1) {
fprintf (stderr, "debugger-agent: Unable to listen on %d\n", socket_fd);
{
int res;
- MONO_PREPARE_BLOCKING;
+ MONO_ENTER_GC_SAFE;
do {
res = send (conn_fd, data, len, 0);
} while (res == -1 && get_last_sock_error () == MONO_EINTR);
- MONO_FINISH_BLOCKING;
+ MONO_EXIT_GC_SAFE;
if (res != len)
return FALSE;
FD_ZERO (&readfds);
FD_SET (sfd, &readfds);
- MONO_PREPARE_BLOCKING;
+ MONO_ENTER_GC_SAFE;
res = select (sfd + 1, &readfds, NULL, NULL, &tv);
- MONO_FINISH_BLOCKING;
+ MONO_EXIT_GC_SAFE;
if (res == 0) {
fprintf (stderr, "debugger-agent: Timed out waiting to connect.\n");
if (sfd == -1)
continue;
- MONO_PREPARE_BLOCKING;
+ MONO_ENTER_GC_SAFE;
res = connect (sfd, &sockaddr.addr, sock_len);
- MONO_FINISH_BLOCKING;
+ MONO_EXIT_GC_SAFE;
if (res != -1)
break; /* Success */
- MONO_PREPARE_BLOCKING;
+ MONO_ENTER_GC_SAFE;
close (sfd);
- MONO_FINISH_BLOCKING;
+ MONO_EXIT_GC_SAFE;
}
if (rp == 0) {
#else
shutdown (conn_fd, SHUT_RD);
shutdown (listen_fd, SHUT_RDWR);
- MONO_PREPARE_BLOCKING;
+ MONO_ENTER_GC_SAFE;
close (listen_fd);
- MONO_FINISH_BLOCKING;
+ MONO_EXIT_GC_SAFE;
#endif
}
DEBUG_PRINTF (1, "[%p] Interrupting %p...\n", (gpointer) (gsize) mono_native_thread_id_get (), (gpointer)tid);
- /* This is _not_ equivalent to ves_icall_System_Threading_Thread_Abort () */
+ /* This is _not_ equivalent to mono_thread_internal_abort () */
InterruptData interrupt_data = { 0 };
interrupt_data.tls = tls;
/*
* Take the loader lock to avoid race conditions with CMD_VM_ABORT_INVOKE:
*
- * It is possible that ves_icall_System_Threading_Thread_Abort () was called
+ * It is possible that mono_thread_internal_abort () was called
* after the mono_runtime_invoke_checked() already returned, but it doesn't matter
* because we reset the abort here.
*/
tls->abort_requested = TRUE;
- ves_icall_System_Threading_Thread_Abort (THREAD_TO_INTERNAL (thread), NULL);
+ mono_thread_internal_abort (THREAD_TO_INTERNAL (thread));
mono_loader_unlock ();
break;
}
// FIXME: Generics
switch (mono_metadata_token_code (token)) {
case MONO_TOKEN_STRING: {
+ MonoError error;
MonoString *s;
char *s2;
- s = mono_ldstr (domain, method->klass->image, mono_metadata_token_index (token));
- g_assert (s);
+ s = mono_ldstr_checked (domain, method->klass->image, mono_metadata_token_index (token), &error);
+ mono_error_assert_ok (&error); /* FIXME don't swallow the error */
s2 = mono_string_to_utf8 (s);