pth - thread startet nicht



  • hallo, ich hab folgenden code aus dem beispiel der pth-doku genommen ( leicht modifiziert und nur das wesentliche genommen ) leider funktioniert er komischerweise nicht:

    #include <stdlib.h>
    #include <stdio.h>
    #include <string.h>
    #include <arpa/inet.h>
    #include <unistd.h>
    #include <pth.h>
    
    static void *ticker( void *_arg ) {
      printf( "hallo welt\n" );
    
      return NULL;
    }
    
    int main( int argc, char *argv[] ) {
      pth_init();
    
      pth_attr_t attr;
    
      attr = pth_attr_new();
      pth_attr_set( attr, PTH_ATTR_NAME, "ticker" );
      pth_attr_set( attr, PTH_ATTR_STACK_SIZE, 64 * 1024 );
      pth_attr_set( attr, PTH_ATTR_JOINABLE, FALSE );
      pth_spawn( attr, ticker, NULL );
    
      for( ; ; ) { 
    
      }
    }
    

    weiss jemand warum? der thread wird einfach nicht ausgeführt..

    mfg blan


Anmelden zum Antworten