Hmm, pthread, I see.  Is there some way I can make them work together
nicely?  Even when I never call wait_until_no_display, ruby still
doesn't exit properly.  I've tried using at_exit to add a handler that
cleans-up the xosd library properly, which should clean up any threads
it's using, but that doesn't seem to help either.

I've tried running my simple test (that usually fails) it in gdb, but that
seems to make the problem disapear.  I've run my larger application that
uses xosd in gdb, and when it locks during exit, this is the backtrace:
#0  0x402ed354 in __pthread_sigsuspend () from /lib/libpthread.so.0
#1  0xbffff6f8 in ?? ()
#2  0x402ed118 in __pthread_wait_for_restart_signal ()
   from /lib/libpthread.so.0
#3  0x402ecd29 in pthread_onexit_process () from /lib/libpthread.so.0
#4  0x40139a92 in exit () from /lib/libc.so.6
#5  0x4003b7d9 in ruby_stop () from /usr/lib/libruby.so.1.6
#6  0x4003b8e6 in ruby_run () from /usr/lib/libruby.so.1.6
#7  0x080485b4 in main ()
#8  0x40123e3e in __libc_start_main () from /lib/libc.so.6

Definitely related to phread.  Any C/pthread gurus out there know what
this means?  If there's some way I can properly shutdown the pthreads...

On Thu, 4 Dec 2003, ts wrote:

> >>>>> "D" == Derek Lewis <lewisd / f00f.net> writes:
>
> D> I've written a small test script that seems to cause the problem about as
> D> often as I can get it to, and I'm hoping someone with a bit more
> D> experience with writing extensions can take a look and help me out.
>
>  It use pthread.
>
>  Now don't expect it to work actually with ruby thread. If you want to use
>  xosd_wait_until_no_display() emulate it like described in the manual page.
>
>  Perhaps you can also use the CVS version of ruby, compiled with
>  --enable-pthread
>
>
> Guy Decoux
>
>

Derek Lewis

===================================================================
      Java Web-Application Developer

      Email    : email / lewisd.com
      Cellular : 604.312.2846
      Website  : http://www.lewisd.com

 "If you've got a 5000-line JSP page that has "all in one" support
 for three input forms and four follow-up screens, all controlled
 by "if" statements in scriptlets, well ... please don't show it
 to me :-).  Its almost dinner time, and I don't want to lose my
 appetite :-)."
      - Craig R. McClanahan