[threads] Remove ThreadState_StopRequested (#4462)
[mono.git] / mono / metadata / object-internals.h
index 67a185e07fa7565497e266f7cdcac2fe40df8220..3e6c7f3e47ba3a874700f2cbb341563f2fa0df42 100644 (file)
@@ -171,6 +171,9 @@ struct _MonoAppDomain {
 /* Safely access System.AppDomain from native code */
 TYPED_HANDLE_DECL (MonoAppDomain);
 
+/* Safely access System.AppDomainSetup from native code.  (struct is in domain-internals.h) */
+TYPED_HANDLE_DECL (MonoAppDomainSetup);
+
 typedef struct _MonoStringBuilder MonoStringBuilder;
 
 struct _MonoStringBuilder {
@@ -359,14 +362,14 @@ struct _MonoInternalThread {
        volatile int lock_thread_id; /* to be used as the pre-shifted thread id in thin locks. Used for appdomain_ref push/pop */
        MonoThreadHandle *handle;
        gpointer native_handle;
-       MonoArray  *cached_culture_info;
+       gpointer unused3;
        gunichar2  *name;
        guint32     name_len;
        guint32     state;
        MonoException *abort_exc;
        int abort_state_handle;
        guint64 tid;    /* This is accessed as a gsize in the code (so it can hold a 64bit pointer on systems that need it), but needs to reserve 64 bits of space on all machines as it corresponds to a field in managed code */
-       gpointer stack_ptr;
+       gsize debugger_thread; // FIXME switch to bool as soon as CI testing with corlib version bump works
        gpointer *static_data;
        void *thread_info; /*This is MonoThreadInfo*, but to simplify dependencies, let's make it a void* here. */
        MonoAppContext *current_appcontext;
@@ -375,7 +378,7 @@ struct _MonoInternalThread {
        int _serialized_principal_version;
        gpointer appdomain_refs;
        /* This is modified using atomic ops, so keep it a gint32 */
-       gint32 interruption_requested;
+       gint32 __interruption_requested;
        MonoCoopMutex *synch_cs;
        MonoBoolean threadpool_thread;
        MonoBoolean thread_interrupt_requested;
@@ -385,21 +388,22 @@ struct _MonoInternalThread {
        gint32 managed_id;
        guint32 small_id;
        MonoThreadManageCallback manage_callback;
-       gpointer interrupt_on_stop;
+       gpointer unused4;
        gsize    flags;
        gpointer thread_pinning_ref;
-       gsize abort_protected_block_count;
+       gsize __abort_protected_block_count;
        gint32 priority;
        GPtrArray *owned_mutexes;
        MonoOSEvent *suspended;
        gint32 self_suspended; // TRUE | FALSE
+
+       gsize thread_state;
        /* 
         * These fields are used to avoid having to increment corlib versions
         * when a new field is added to this structure.
         * Please synchronize any changes with InternalThread in Thread.cs, i.e. add the
         * same field there.
         */
-       gsize unused1;
        gsize unused2;
 
        /* This is used only to check that we are in sync between the representation
@@ -1479,6 +1483,9 @@ mono_get_constant_value_from_blob (MonoDomain* domain, MonoTypeEnum type, const
 void
 mono_release_type_locks (MonoInternalThread *thread);
 
+int
+mono_string_handle_length (MonoStringHandle s);
+
 char *
 mono_string_handle_to_utf8 (MonoStringHandle s, MonoError *error);
 
@@ -1489,8 +1496,8 @@ char *
 mono_string_to_utf8_image (MonoImage *image, MonoStringHandle s, MonoError *error);
 
 
-MonoArray*
-mono_array_clone_in_domain (MonoDomain *domain, MonoArray *array, MonoError *error);
+MonoArrayHandle
+mono_array_clone_in_domain (MonoDomain *domain, MonoArrayHandle array, MonoError *error);
 
 MonoArray*
 mono_array_clone_checked (MonoArray *array, MonoError *error);
@@ -1783,6 +1790,9 @@ mono_string_new_checked (MonoDomain *domain, const char *text, MonoError *merror
 MonoString *
 mono_string_new_utf16_checked (MonoDomain *domain, const guint16 *text, gint32 len, MonoError *error);
 
+MonoStringHandle
+mono_string_new_utf16_handle (MonoDomain *domain, const guint16 *text, gint32 len, MonoError *error);
+
 MonoString *
 mono_string_from_utf16_checked (mono_unichar2 *data, MonoError *error);