Permalink
Browse files

More semaphores in Java code

  • Loading branch information...
pelya committed Mar 23, 2013
1 parent 5065c1a commit f0e8a3d12f90fe2e4a6038b3ba95693db27b64e1
Showing with 5 additions and 1 deletion.
  1. +4 −0 project/java/MainActivity.java
  2. +1 −1 project/jni/application/openarena/engine
@@ -100,6 +100,8 @@ protected void onCreate(Bundle savedInstanceState)
_layout2 = new LinearLayout(this);
_layout2.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
+ final Semaphore loadedLibraries = new Semaphore(0);
+
if( Globals.StartupMenuButtonTimeout > 0 )
{
_btn = new Button(this);
@@ -113,6 +115,7 @@ public void onClick(View v)
{
setUpStatusLabel();
System.out.println("libSDL: User clicked change phone config button");
+ loadedLibraries.acquireUninterruptibly();
Settings.showConfig(p, false);
}
};
@@ -173,6 +176,7 @@ public void run()
{
Settings.Load(Parent);
loaded.release();
+ loadedLibraries.release();
}
}
Callback2 cb = new Callback2();

0 comments on commit f0e8a3d

Please sign in to comment.