[sgen] Remove an incorrect assertion in the workers code and explain.
[mono.git] / mono / metadata / sgen-os-posix.c
index e66bc4578510a652df65e293f43e4eac34bfa2c2..f4f4a8a44a0067e976b503d777cb8a19f4418b00 100644 (file)
@@ -41,27 +41,23 @@ int
 mono_sgen_thread_handshake (int signum)
 {
        int count, i, result;
-       SgenThreadInfo **thread_table;
        SgenThreadInfo *info;
        pthread_t me = pthread_self ();
 
-       thread_table = mono_sgen_get_thread_table ();
        count = 0;
-       for (i = 0; i < THREAD_HASH_SIZE; ++i) {
-               for (info = thread_table [i]; info; info = info->next) {
-                       if (ARCH_THREAD_EQUALS (info->id, me)) {
-                               continue;
-                       }
-                       /*if (signum == suspend_signal_num && info->stop_count == global_stop_count)
-                               continue;*/
-                       result = pthread_kill (info->id, signum);
-                       if (result == 0) {
-                               count++;
-                       } else {
-                               info->skip = 1;
-                       }
+       FOREACH_THREAD (info) {
+               if (ARCH_THREAD_EQUALS (info->id, me)) {
+                       continue;
                }
-       }
+               /*if (signum == suspend_signal_num && info->stop_count == global_stop_count)
+                       continue;*/
+               result = pthread_kill (info->id, signum);
+               if (result == 0) {
+                       count++;
+               } else {
+                       info->skip = 1;
+               }
+       } END_FOREACH_THREAD
 
        mono_sgen_wait_for_suspend_ack (count);