GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [docs update]增加状态 · MonsterFanSec/JavaGuide@330d1dc

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • docs/java/concurrent
    • java-concurrent-questions-03.md
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎docs/java/concurrent/java-concurrent-questions-03.md‎

Copy file name to clipboardExpand all lines: docs/java/concurrent/java-concurrent-questions-03.md
+4-2Lines changed: 4 additions & 2 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,10 @@ public void allowCoreThreadTimeOut(boolean value) {
365365

366366
核心线程空闲时,其状态分为以下两种情况:
367367

368-
- **设置了核心线程的存活时间** :核心线程在空闲时,会处于阻塞状态,等待获取任务。如果阻塞等待的时间超过了核心线程存活时间,则该线程会退出工作,之后将该线程从线程池的工作线程集合中移除。
369-
- **没有设置核心线程的存活时间** :核心线程在空闲时,会一直处于阻塞状态,等待获取任务。
368+
- **设置了核心线程的存活时间** :核心线程在空闲时,会处于 `WAITING` 状态,等待获取任务。如果阻塞等待的时间超过了核心线程存活时间,则该线程会退出工作,将该线程从线程池的工作线程集合中移除,线程状态变为 `TERMINATED` 状态。
369+
- **没有设置核心线程的存活时间** :核心线程在空闲时,会处于 `WAITING` 状态,等待获取任务。
370+
371+
当核心线程获取任务之后,会由 `WAITING` 状态变为 `RUNNABLE` 状态,之后去执行对应任务。
370372

371373
#### 相关源码
372374

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.