Changeset 16 for chess


Ignore:
Timestamp:
02/03/09 15:07:50 (13 years ago)
Author:
BegemoT
Message:

something different

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chess/src/chess/control/BaseController.java

    r15 r16  
    6060            synchronized ( this ) { 
    6161                try { 
    62                     wait(); 
     62                    if ( player == null ) { 
     63                        //ñòàðõóåìñÿ íà ñëó÷àé, åñëè ñîáûòèÿ óæå óñïåëè ïðèéòè 
     64                        wait(); 
     65                    } 
    6366                } catch ( InterruptedException e ) { 
    6467                    e.printStackTrace(); 
     
    114117    protected void processSystemAction( final SystemAction sa ) { 
    115118        if ( sa.type() == SystemAction.SET_PLAYER ) { 
    116             player = sa.getPlayer(); 
     119            synchronized ( this ) { 
     120                player = sa.getPlayer(); 
     121            } 
    117122            if ( isMaster() ) { 
    118123                throw new IllegalStateException( "Master should not got SET_PLAYER commands" ); 
Note: See TracChangeset for help on using the changeset viewer.