-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Hi,

Who can i just spawn a thread from a function ?
By what THREAD_LOOP must be replaced, or how this must made ?
Thx, i can't find this information anywhere..

ex:
==


#define THREAD_LOOP(x) while (1) pth_sleep (x)

static void* my_handler (_arg)
  void* _arg;
{
  int tmp;

  while (1)
    scanf ("%u", &tmp);
}

/* ----- */

int
my_spawn (void)
{
  pth_attr_t attr = pth_attr_new ();
  (void) pth_spawn (attr, my_handler, NULL);
  pth_attr_destroy (attr);
  
  THREAD_LOOP(5);

  /* UNREACHABLE */
  return 0;
}

/* ----- */

int
main (void)
{
  (void) my_spawn ();

  return 0;
}

this code generate this gdb output :

Program received signal SIGSEGV, Segmentation fault.
0x400203b2 in pth_key_getdata ()
(gdb) bt
#0  0x400203b2 in pth_key_getdata ()
#1  0x4001fc7a in pth_event ()
#2  0x40021925 in pth_sleep ()
#3  0x1833 in my_spawn ()
#4  0x184d in main ()

with GNU Pth 1.3.7 (29-Jul-2000)


DIAS DA SILVA LOIC (Mglcel) <[EMAIL PROTECTED]>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.0 (NetBSD)
Comment: Processed by Mailcrypt 3.5.5 and Gnu Privacy Guard <http://www.gnupg.org/>

iD8DBQE6KuLeKjPxKQhsma0RAnd4AJ9b5AqRh3DYuWdY8hWscmvMnxe+pACgnc5u
2PTxUsoCbeBu7V6F4ydJ2oU=
=Pl9k
-----END PGP SIGNATURE-----
______________________________________________________________________
GNU Portable Threads (Pth)            http://www.gnu.org/software/pth/
User Support Mailing List                            [EMAIL PROTECTED]
Automated List Manager (Majordomo)           [EMAIL PROTECTED]

Reply via email to