コード例 #1
0
 private void wait_until_safe() {
   while (!safe_modify) {
     // loop until safe to modify;
     try {
       Thread.sleep(1);
     } catch (Exception ex) {
       ex.printStackTrace();
     }
   }
 }
コード例 #2
0
 public void update() {
   // execute orders
   safe_modify = false;
   try {
     Thread.sleep(1);
   } catch (Exception ex) {
   }
   ;
   for (Spatial_Order order : orders) {
     try {
       execute(order);
     } catch (Exception ex) {
     }
     ;
   }
   orders.clear();
   safe_modify = true;
 }