252 |
{ |
{ |
253 |
// Bypass System.getSecurityManager, for bootstrap efficiency. |
// Bypass System.getSecurityManager, for bootstrap efficiency. |
254 |
SecurityManager sm = Runtime.securityManager; |
SecurityManager sm = Runtime.securityManager; |
255 |
|
Thread current = currentThread(); |
256 |
if (group == null) |
if (group == null) |
257 |
{ |
{ |
258 |
if (sm != null) |
if (sm != null) |
259 |
group = sm.getThreadGroup(); |
group = sm.getThreadGroup(); |
260 |
if (group == null) |
if (group == null) |
261 |
group = currentThread().group; |
{ |
262 |
|
if (current == null) |
263 |
|
group = ThreadGroup.root; |
264 |
|
else |
265 |
|
group = current.group; |
266 |
|
} |
267 |
} |
} |
268 |
else if (sm != null) |
else if (sm != null) |
269 |
sm.checkAccess(group); |
sm.checkAccess(group); |
272 |
// Use toString hack to detect null. |
// Use toString hack to detect null. |
273 |
this.name = name.toString(); |
this.name = name.toString(); |
274 |
this.toRun = toRun; |
this.toRun = toRun; |
275 |
Thread current = currentThread(); |
if (current == null) |
276 |
priority = current.priority; |
{ |
277 |
daemon = current.daemon; |
priority = NORM_PRIORITY; |
278 |
|
daemon = false; |
279 |
|
} |
280 |
|
else |
281 |
|
{ |
282 |
|
priority = current.priority; |
283 |
|
daemon = current.daemon; |
284 |
|
} |
285 |
nativeInit(size); |
nativeInit(size); |
286 |
|
|
287 |
group.addThread(this); |
group.addThread(this); |