Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualSollum

Posted 19 March 2013 - 03:43 PM

Hmmm, thanks for the tips!

 

For now i'll try to refrain from using threads.

 

Edit:

Do GLSurfaceView.Renderer and Activity start in different threads?

 

Because i stumbled upon that ugly problem ConcurentModificationException in a list.

 

Wrote some locks, but frankly... they look bad >.<

 

 

 

private boolean bIIA_ListLocked;

public boolean isIIALLocked()
{
   return bIIA_ListLocked;
}


public void lockIIAL()
{
   bIIA_ListLocked = true;
}


public void unlockIIAL()
{
   bIIA_ListLocked = false;
}


public void manageEvents()
{
   if (!isIIALLocked())
   {
      lockIIAL();

      for (InterfaceInputAction IIA : IIA_List)
      {
         System.out.println(IIA.getSource() + " " + IIA.getAction());
      }

      IIA_List.clear();

      unlockIIAL();
   }
}


private void addInputEvent(InterfaceInputAction IIA)
{
   if (!isIIALLocked())
   {
      lockIIAL();

      IIA_List.add(IIA);

      unlockIIAL();
   }
}
 

#1Sollum

Posted 19 March 2013 - 12:00 PM

Hmmm, thanks for the tips!

 

For now i'll try to refrain from using threads.


PARTNERS