/[guile]/guile/guile-core/libguile/threads.c
ViewVC logotype

Diff of /guile/guile-core/libguile/threads.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.44 by mdj, Mon Dec 16 15:24:13 2002 UTC revision 1.45 by mdj, Wed Dec 18 10:53:23 2002 UTC
# Line 346  really_launch (SCM_STACKITEM *base, laun Line 346  really_launch (SCM_STACKITEM *base, laun
346    all_threads = scm_delq_x (thread, all_threads);    all_threads = scm_delq_x (thread, all_threads);
347    t->exited = 1;    t->exited = 1;
348    thread_count--;    thread_count--;
349    scm_i_plugin_mutex_unlock (&thread_admin_mutex);    /* detach before unlocking in order to not become joined when detached */
   
350    scm_thread_detach (t->thread);    scm_thread_detach (t->thread);
351      scm_i_plugin_mutex_unlock (&thread_admin_mutex);
352  }  }
353    
354  static void *  static void *
# Line 1262  scm_i_thread_put_to_sleep () Line 1262  scm_i_thread_put_to_sleep ()
1262              scm_i_plugin_mutex_lock (&t->heap_mutex);              scm_i_plugin_mutex_lock (&t->heap_mutex);
1263            }            }
1264        scm_i_thread_go_to_sleep = 0;        scm_i_thread_go_to_sleep = 0;
       scm_i_plugin_mutex_unlock (&thread_admin_mutex);  
1265      }      }
1266  }  }
1267    
1268  void  void
1269  scm_i_thread_invalidate_freelists ()  scm_i_thread_invalidate_freelists ()
1270  {  {
1271    /* Don't need to lock thread_admin_mutex here since we are sinle threaded */    /* Don't need to lock thread_admin_mutex here since we are single threaded */
1272    SCM threads = all_threads;    SCM threads = all_threads;
1273    for (; !SCM_NULLP (threads); threads = SCM_CDR (threads))    for (; !SCM_NULLP (threads); threads = SCM_CDR (threads))
1274      if (SCM_CAR (threads) != cur_thread)      if (SCM_CAR (threads) != cur_thread)
# Line 1285  scm_i_thread_wake_up () Line 1284  scm_i_thread_wake_up ()
1284    if (threads_initialized_p && !--gc_section_count)    if (threads_initialized_p && !--gc_section_count)
1285      {      {
1286        SCM threads;        SCM threads;
       /* Need to lock since woken threads can die and be deleted from list */  
       scm_i_plugin_mutex_lock (&thread_admin_mutex);  
1287        threads = all_threads;        threads = all_threads;
1288        scm_i_plugin_cond_broadcast (&wake_up_cond);        scm_i_plugin_cond_broadcast (&wake_up_cond);
1289        for (; !SCM_NULLP (threads); threads = SCM_CDR (threads))        for (; !SCM_NULLP (threads); threads = SCM_CDR (threads))

Legend:
Removed from v.1.44  
changed lines
  Added in v.1.45

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26