This is the mail archive of the java-discuss@sourceware.cygnus.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: porting libjava to FreeBSD


Mikhail Teterin wrote:
> 
> However,  the low  level code  in libgcj-2.95.1/boehm-gc/linux_threads.c
> uses the  non-existent (on  FreeBSD) signal  SIGPWR. With  the following
> comment:
> 
>       /*
>        * The  only way  to suspend  threads given  the pthread
>        * interface is  to send  signals. We can't  use SIGSTOP
>        * directly, because we  need to get the  thread to save
>        * its  stack  pointer in  the  GC  thread table  before
>        * suspending. So we have to reserve a signal of our own
>        * for  this. This  means  we have  to intercept  client
>        * calls  to change  the signal  mask. The  linuxthreads
>        * package already uses SIGUSR1  and SIGUSR2, so we need
>        * to  reuse something  else. I  chose SIGPWR.  (Perhaps
>        * SIGUNUSED would be a better choice.)
>        */
>       #define SIG_SUSPEND SIGPWR

Ick.

I think it would be better to suspend threads using
pthread_suspend_np().

John

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]