//output:012 for (int i = 0; i < 5; i++) { if(i>2)break; System.out.print(i); }
/** * outer:1 * inner not break:2 * outer:3 */ for (int i = 0; i < 2; ) { while (i++<2){ if(i<2) break;//i<2时结束内层循环 System.out.println("inner not break:"+i); } System.out.println("outer:"+i); }
Each action in a thread happens-before every action in that thread that comes later in the program’s order.
An unlock (synchronized block or method exit) of a monitor happens-before every subsequent lock (synchronized block or method entry) of that same monitor. And because the happens-before relation is transitive, all actions of a thread prior to unlocking happen-before all actions subsequent to any thread locking that monitor.
A write to a volatile field happens-before every subsequent read of that same field. Writes and reads of volatile fields have similar memory consistency effects as entering and exiting monitors, but do not entail mutual exclusion locking.
A call to start on a thread happens-before any action in the started thread.
All actions in a thread happen-before any other thread successfully returns from a join on that thread.
I125: Setting destination path for vmnet to "/lib/modules/4.9.0-11-generic/misc/vmnet.ko". I125: Extracting the vmnet source from "/usr/lib/vmware/modules/source/vmnet.tar". I125: Successfully extracted the vmnet source. I125: Building module with command"/usr/bin/make -j4 -C /tmp/modconfig-Zu8VZj/vmnet-only auto-build HEADER_DIR=/lib/modules/4.9.0-11-generic/build/include CC=/usr/bin/gcc IS_GCC_3=no" W115: Failed to build vmnet. Failed to execute the build command.