nevo / podchess

Automatically exported from code.google.com/p/podchess
GNU General Public License v3.0
0 stars 0 forks source link

The loop in "robotThread" runs many times before the 1st move is made #15

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
... That may be the reason why it takes a *some* time (about 1 second) before 
the hint-move 
highlighting takes place (for the very 1st Move made by human).

//////////////////////////
- (void)robotThread:(void*)param
{
  ............
    do   // Let the run loop process things.
    {
        [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode
                                 beforeDate:[NSDate distantFuture]];
        // *** THIS WILL BE EXECUTED MANY TIMES BEFORE THE 1ST MOVE IS MADE
    } while (YES);
   ......... 
}

Original issue reported on code.google.com by huypha...@gmail.com on 9 Oct 2009 at 3:15

GoogleCodeExporter commented 9 years ago
hi, Huy:
   Yeah...  it will repeatedly loop when in idle (without any input source or timer attached).  Postpone it to run on 
the first Robot move should be okay.

Original comment by Sakur.de...@gmail.com on 9 Oct 2009 at 3:49

GoogleCodeExporter commented 9 years ago
fixed on r83. Also fixed the crash on reset when AI is thinking

Original comment by Sakur.de...@gmail.com on 10 Oct 2009 at 4:43