TThreads and TMonitor::Select

[quote=“jaromrax”]This is shortest crash example I am able to prepare:

#include "TSocket.h"   
#include "TServerSocket.h"
#include "TMonitor.h"
#include "TThread.h"  

void* net_server( void* arg )  
{
    int port=9999;
//===================================================================
   printf("%s\n" ,"entered main while loop in net_server. Dont send anything just keep <enter>");
   TServerSocket *ss = new TServerSocket(port, kTRUE);
   TMonitor *mon = new TMonitor;
   mon->Add(ss);
   TSocket *s0 = 0;
     TSocket  *s=NULL;
     mon->ResetInterrupt();
     s=mon->Select( );
     printf("%d:%s",(int)s,"...dies before exiting Select() \n" );fflush(stdout);

//===================================================================
}



void testbench2(){
    TThread* thread;
    thread = new TThread( "my_server" , net_server, NULL );
    if (thread==NULL){ printf("exiting, thread 1 not running\n%s","");return ;}
    thread->Run();
}// .....................................................................testbench2

Even completely without timeout.[/quote]
thank you, I’ll check it out.