[threads] Store MonoInternalThread in MonoThreadInfo for use when detaching (#5058)
[mono.git] / mono / unit-tests / test-mono-linked-list-set.c
index 3841581e0bb02fd61fe9f407dbcbef8891a0cea9..202d2fc07a11a46caf2006184fb44e72a7d68f84 100644 (file)
@@ -74,11 +74,11 @@ worker (void *arg)
                        break;
                case STATE_OUT:
                        if (InterlockedCompareExchange (&nodes [i].state, STATE_BUSY, STATE_OUT) == STATE_OUT) {
-                               result = mono_lls_find (&lls, hp, i, HAZARD_FREE_SAFE_CTX);
+                               result = mono_lls_find (&lls, hp, i);
                                assert (!result);
                                mono_hazard_pointer_clear_all (hp, -1);
 
-                               result = mono_lls_insert (&lls, hp, &nodes [i].node, HAZARD_FREE_SAFE_CTX);
+                               result = mono_lls_insert (&lls, hp, &nodes [i].node);
                                mono_hazard_pointer_clear_all (hp, -1);
 
                                assert (nodes [i].state == STATE_BUSY);
@@ -89,12 +89,12 @@ worker (void *arg)
                        break;
                case STATE_IN:
                        if (InterlockedCompareExchange (&nodes [i].state, STATE_BUSY, STATE_IN) == STATE_IN) {
-                               result = mono_lls_find (&lls, hp, i, HAZARD_FREE_SAFE_CTX);
+                               result = mono_lls_find (&lls, hp, i);
                                assert (result);
                                assert (mono_hazard_pointer_get_val (hp, 1) == &nodes [i].node);
                                mono_hazard_pointer_clear_all (hp, -1);
 
-                               result = mono_lls_remove (&lls, hp, &nodes [i].node, HAZARD_FREE_SAFE_CTX);
+                               result = mono_lls_remove (&lls, hp, &nodes [i].node);
                                mono_hazard_pointer_clear_all (hp, -1);
 
                                ++thread_data->num_removes;
@@ -116,17 +116,14 @@ int
 main (int argc, char *argv [])
 {
        int primes [] = { 1, 2, 3, 5, 7, 11, 13, 17 };
-       MonoThreadInfoCallbacks thread_callbacks;
        thread_data_t thread_data [NUM_THREADS];
        int i;
 
-       memset (&thread_callbacks, 0, sizeof (thread_callbacks));
-
        mono_metadata_init ();
 
-       mono_threads_init (&thread_callbacks, 0);
+       mono_thread_info_init (0);
 
-       mono_lls_init (&lls, free_node, HAZARD_FREE_NO_LOCK);
+       mono_lls_init (&lls, free_node);
 
        for (i = 0; i < N; ++i) {
                nodes [i].node.key = i;