user manual code example race condition
"dingd" <[email protected]>
| Newsgroups | gmane.editors.j.devel |
|---|---|
| Message-ID | <tencent_51BB658CB0CA57E52D32EEC4D60C5B10EE06__48286.8379725673$1552285411$gmane$org@qq.com> |
this is recommended in the manual, it contains a race condition.
Interpreter interpreter = Interpreter.getInstance ();
if ( interpreter == null ) {
interpreter = Interpreter.createInstance ();
}
getInstance and createInstance should be swapped.