Branch: Tag:

2010-11-05

2010-11-05 17:59:38 by Martin Stjernholm <mast@lysator.liu.se>

Use a local backend for the pipes in Process.run.

230: Inside #if constant(Thread.Thread)
   exitcode = p->wait();    threads->wait();   #else //No threads, use callbacks +  Pike.SmallBackend backend = Pike.SmallBackend(); +  +  mystdout->set_backend (backend); +  mystderr->set_backend (backend); +     mystdout->set_read_callback( lambda( mixed i, string data) {    gotstdout += data;    } );
246:    });       if (mystdin) { -  Shuffler.Shuffle sf = Shuffler.Shuffler()->shuffle( mystdin ); +  Shuffler.Shuffler sfr = Shuffler.Shuffler(); +  sfr->set_backend (backend); +  Shuffler.Shuffle sf = sfr->shuffle( mystdin );    sf->add_source(stdin_str);    sf->set_done_callback (lambda () {    mystdin = 0;
255:    }       while( mystdout || mystderr || mystdin ) -  Pike.DefaultBackend( 1.0 ); +  backend( 1.0 );       exitcode = p->wait();   #endif