2387 }
2388
2389 void ObjectMonitor::DeferredInitialize () {
2390 if (InitDone > 0) return ;
2391 if (Atomic::cmpxchg (-1, &InitDone, 0) != 0) {
2392 while (InitDone != 1) ;
2393 return ;
2394 }
2395
2396 // One-shot global initialization ...
2397 // The initialization is idempotent, so we don't need locks.
2398 // In the future consider doing this via os::init_2().
2399 // SyncKnobs consist of <Key>=<Value> pairs in the style
2400 // of environment variables. Start by converting ':' to NUL.
2401
2402 if (SyncKnobs == NULL) SyncKnobs = "" ;
2403
2404 size_t sz = strlen (SyncKnobs) ;
2405 char * knobs = (char *) malloc (sz + 2) ;
2406 if (knobs == NULL) {
2407 vm_exit_out_of_memory (sz + 2, "Parse SyncKnobs") ;
2408 guarantee (0, "invariant") ;
2409 }
2410 strcpy (knobs, SyncKnobs) ;
2411 knobs[sz+1] = 0 ;
2412 for (char * p = knobs ; *p ; p++) {
2413 if (*p == ':') *p = 0 ;
2414 }
2415
2416 #define SETKNOB(x) { Knob_##x = kvGetInt (knobs, #x, Knob_##x); }
2417 SETKNOB(ReportSettings) ;
2418 SETKNOB(Verbose) ;
2419 SETKNOB(FixedSpin) ;
2420 SETKNOB(SpinLimit) ;
2421 SETKNOB(SpinBase) ;
2422 SETKNOB(SpinBackOff);
2423 SETKNOB(CASPenalty) ;
2424 SETKNOB(OXPenalty) ;
2425 SETKNOB(LogSpins) ;
2426 SETKNOB(SpinSetSucc) ;
2427 SETKNOB(SuccEnabled) ;
|
2387 }
2388
2389 void ObjectMonitor::DeferredInitialize () {
2390 if (InitDone > 0) return ;
2391 if (Atomic::cmpxchg (-1, &InitDone, 0) != 0) {
2392 while (InitDone != 1) ;
2393 return ;
2394 }
2395
2396 // One-shot global initialization ...
2397 // The initialization is idempotent, so we don't need locks.
2398 // In the future consider doing this via os::init_2().
2399 // SyncKnobs consist of <Key>=<Value> pairs in the style
2400 // of environment variables. Start by converting ':' to NUL.
2401
2402 if (SyncKnobs == NULL) SyncKnobs = "" ;
2403
2404 size_t sz = strlen (SyncKnobs) ;
2405 char * knobs = (char *) malloc (sz + 2) ;
2406 if (knobs == NULL) {
2407 vm_exit_out_of_memory (sz + 2, OOM_MALLOC_ERROR, "Parse SyncKnobs") ;
2408 guarantee (0, "invariant") ;
2409 }
2410 strcpy (knobs, SyncKnobs) ;
2411 knobs[sz+1] = 0 ;
2412 for (char * p = knobs ; *p ; p++) {
2413 if (*p == ':') *p = 0 ;
2414 }
2415
2416 #define SETKNOB(x) { Knob_##x = kvGetInt (knobs, #x, Knob_##x); }
2417 SETKNOB(ReportSettings) ;
2418 SETKNOB(Verbose) ;
2419 SETKNOB(FixedSpin) ;
2420 SETKNOB(SpinLimit) ;
2421 SETKNOB(SpinBase) ;
2422 SETKNOB(SpinBackOff);
2423 SETKNOB(CASPenalty) ;
2424 SETKNOB(OXPenalty) ;
2425 SETKNOB(LogSpins) ;
2426 SETKNOB(SpinSetSucc) ;
2427 SETKNOB(SuccEnabled) ;
|