at android.support.v4.app.FragmentManagerImpl.checkStateLoss(SourceFile:1493) at android.support.v4.app.FragmentManagerImpl.enqueueAction(SourceFile:1511) at android.support.v4.app.BackStackRecord.commitInternal(SourceFile:638) at android.support.v4.app.BackStackRecord.commit(SourceFile:617) at com.myapp.MainActivity.navigateToFragment(SourceFile:519) at com.myapp.MainActivity.onNavigationDrawerItemSelected(SourceFile:360) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:168) at android.app.ActivityThread.main(ActivityThread.java:5885) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:797) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:687) @ErikHellman - www.hellsoft.se - [email protected] 12
new_pid = fork(); if(new_pid == 0) { // Child process init goes here } else { // Parent process registers new child here } } // fork() is implemented in the kernel using clone() clone(SIGCHLD, 0); @ErikHellman - www.hellsoft.se - [email protected] 15
mutable state variable without proper synchronization, your program is broken. -- Java Concurrency in Practice @ErikHellman - www.hellsoft.se - [email protected] 19
thread will be performed in the order given by the program, as long as the reordering is not detectable from within that thread - even if the reordering is apparent to other threads. — Java Concurrency in Practice @ErikHellman - www.hellsoft.se - [email protected] 22
boolean ready; private static int number; private static class ReaderThread extends Thread { public void run() { while(!ready) Thread.yield(); System.out.println(number); } } // The order of execution here is not guaranteed! public static void main(String[] args) { new ReaderThread().start(); number = 42; ready = true; } } @ErikHellman - www.hellsoft.se - [email protected] 23
it should stop what it is doing and do something else. It's up to the programmer to decide exactly how a thread responds to an interrupt, but it is very common for the thread to terminate. — The Java™ Tutorials @ErikHellman - www.hellsoft.se - [email protected] 43