/[dotgnu-pnet]/pnet/libgc/solaris_threads.c
ViewVC logotype

Diff of /pnet/libgc/solaris_threads.c

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

revision 1.3 by rweather, Thu Feb 6 01:35:46 2003 UTC revision 1.4 by ktreichel, Sat Jul 23 12:52:58 2005 UTC
# Line 16  Line 16 
16   */   */
17  /* Boehm, September 14, 1994 4:44 pm PDT */  /* Boehm, September 14, 1994 4:44 pm PDT */
18    
 # if defined(GC_SOLARIS_THREADS) || defined(GC_SOLARIS_PTHREADS)  
   
19  # include "private/gc_priv.h"  # include "private/gc_priv.h"
20    
21    # if defined(GC_SOLARIS_THREADS) || defined(GC_SOLARIS_PTHREADS)
22  # include "private/solaris_threads.h"  # include "private/solaris_threads.h"
23  # include <thread.h>  # include <thread.h>
24  # include <synch.h>  # include <synch.h>
# Line 248  static void stop_all_lwps() Line 248  static void stop_all_lwps()
248      for (i = 0; i < max_lwps; i++)      for (i = 0; i < max_lwps; i++)
249          last_ids[i] = 0;          last_ids[i] = 0;
250      for (;;) {      for (;;) {
251      if (syscall(SYS_ioctl, GC_main_proc_fd, PIOCSTATUS, &status) < 0)          if (syscall(SYS_ioctl, GC_main_proc_fd, PIOCSTATUS, &status) < 0)
252          ABORT("Main PIOCSTATUS failed");              ABORT("Main PIOCSTATUS failed");
253          if (status.pr_nlwp < 1)          if (status.pr_nlwp < 1)
254                  ABORT("Invalid number of lwps returned by PIOCSTATUS");                  ABORT("Invalid number of lwps returned by PIOCSTATUS");
255          if (status.pr_nlwp >= max_lwps) {          if (status.pr_nlwp >= max_lwps) {
# Line 262  static void stop_all_lwps() Line 262  static void stop_all_lwps()
262                  for (i = 0; i < max_lwps; i++)                  for (i = 0; i < max_lwps; i++)
263                          last_ids[i] = 0;                          last_ids[i] = 0;
264                  continue;                  continue;
265      }          }
266          if (syscall(SYS_ioctl, GC_main_proc_fd, PIOCLWPIDS, GC_current_ids) < 0)          if (syscall(SYS_ioctl, GC_main_proc_fd, PIOCLWPIDS, GC_current_ids) < 0)
267              ABORT("PIOCLWPIDS failed");              ABORT("PIOCLWPIDS failed");
268          changed = FALSE;          changed = FALSE;
# Line 786  void GC_thr_init(void) Line 786  void GC_thr_init(void)
786  {  {
787      GC_thread t;      GC_thread t;
788      thread_t tid;      thread_t tid;
789        int ret;
790    
791      if (GC_thr_initialized)      if (GC_thr_initialized)
792              return;              return;
# Line 803  void GC_thr_init(void) Line 804  void GC_thr_init(void)
804        t = GC_new_thread(thr_self());        t = GC_new_thread(thr_self());
805        t -> stack_size = 0;        t -> stack_size = 0;
806        t -> flags = DETACHED | CLIENT_OWNS_STACK;        t -> flags = DETACHED | CLIENT_OWNS_STACK;
807      if (thr_create(0 /* stack */, 0 /* stack_size */, GC_thr_daemon,      ret = thr_create(0 /* stack */, 0 /* stack_size */, GC_thr_daemon,
808                     0 /* arg */, THR_DETACHED | THR_DAEMON,                       0 /* arg */, THR_DETACHED | THR_DAEMON,
809                     &tid /* thread_id */) != 0) {                       &tid /* thread_id */);
810        if (ret != 0) {
811            GC_err_printf1("Thr_create returned %ld\n", ret);
812          ABORT("Cant fork daemon");          ABORT("Cant fork daemon");
813      }      }
814      thr_setprio(tid, 126);      thr_setprio(tid, 126);

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

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