Ticket #765: spin_counter.diff

File spin_counter.diff, 783 bytes (added by Nicolas, 16 years ago)

Apply this patch and watch the counter spin like crazy!

  • clientgui/AsyncRPC.cpp

     
    118118    int retval;
    119119    CRPCFinishedEvent RPC_done_event( wxEVT_RPC_FINISHED );
    120120
     121    unsigned long total_it=0, wasted_it=0;
    121122    while(true) {
     123        total_it++;
     124        if (total_it%1000 == 0) {
     125            printf("total: %lu, wasted: %lu\n", total_it, wasted_it);
     126        }
    122127        // check if we were asked to exit
    123128        if ( TestDestroy() )
    124129            break;
     
    130135#else
    131136            Yield();
    132137#endif
     138            wasted_it++;
    133139            continue;
    134140        }
     141        wasted_it=0;
    135142
    136143        if (! m_pDoc->IsConnected()) {
    137144            Yield();