diff --git a/zh-cn/application-dev/arkts-utils/cpu-intensive-task-development.md b/zh-cn/application-dev/arkts-utils/cpu-intensive-task-development.md index 95e914e223c440ab43e1abc499f28e8df2f98e21..1e1f7b24a13aca4a13b3b260876a66168deaeb4b 100644 --- a/zh-cn/application-dev/arkts-utils/cpu-intensive-task-development.md +++ b/zh-cn/application-dev/arkts-utils/cpu-intensive-task-development.md @@ -83,7 +83,7 @@ struct Index { ![newWorker](figures/newWorker.png) -2. 在主线程ä¸é€šè¿‡è°ƒç”¨[ThreadWorker()](../reference/apis/js-apis-worker.md#threadworker9)方法创建Worker对象,当å‰çº¿ç¨‹ä¸ºå®¿ä¸»çº¿ç¨‹ã€‚ +2. 在主线程ä¸é€šè¿‡è°ƒç”¨ThreadWorkerçš„[constructor()](../reference/apis/js-apis-worker.md#constructor9)方法创建Worker对象,当å‰çº¿ç¨‹ä¸ºå®¿ä¸»çº¿ç¨‹ã€‚ ```js import worker from '@ohos.worker'; @@ -168,9 +168,9 @@ struct Index { } ``` -6. 在Worker线程ä¸å®Œæˆä»»åŠ¡ä¹‹åŽï¼Œæ‰§è¡ŒWorker线程销æ¯æ“ä½œã€‚æ ¹æ®éœ€è¦å¯ä»¥åœ¨å®¿ä¸»çº¿ç¨‹ä¸å¯¹Worker线程进行销æ¯ï¼Œä¹Ÿå¯ä»¥åœ¨Worker线程ä¸ä¸»åŠ¨é”€æ¯Worker线程。 - 在宿主线程ä¸é€šè¿‡è°ƒç”¨[onexit()](../reference/apis/js-apis-worker.md#onexit9)方法定义Worker线程销æ¯åŽçš„处ç†é€»è¾‘。 +6. 在Worker线程ä¸å®Œæˆä»»åŠ¡ä¹‹åŽï¼Œæ‰§è¡ŒWorker线程销æ¯æ“作。销æ¯çº¿ç¨‹çš„æ–¹å¼ä¸»è¦æœ‰ä¸¤ç§ï¼šæ ¹æ®éœ€è¦å¯ä»¥åœ¨å®¿ä¸»çº¿ç¨‹ä¸å¯¹Worker线程进行销æ¯ï¼›ä¹Ÿå¯ä»¥åœ¨Worker线程ä¸ä¸»åŠ¨é”€æ¯Worker线程。 + 在宿主线程ä¸é€šè¿‡è°ƒç”¨[onexit()](../reference/apis/js-apis-worker.md#onexit9)方法定义Worker线程销æ¯åŽçš„处ç†é€»è¾‘。 ```js // Worker线程销æ¯åŽï¼Œæ‰§è¡Œonexit回调方法 @@ -179,15 +179,14 @@ struct Index { } ``` - 在宿主线程ä¸é€šè¿‡è°ƒç”¨[terminate()](../reference/apis/js-apis-worker.md#terminate9)方法销æ¯Worker线程,并终æ¢Worker接收消æ¯ã€‚ - + æ–¹å¼ä¸€ï¼šåœ¨å®¿ä¸»çº¿ç¨‹ä¸é€šè¿‡è°ƒç”¨[terminate()](../reference/apis/js-apis-worker.md#terminate9)方法销æ¯Worker线程,并终æ¢Worker接收消æ¯ã€‚ ```js // 销æ¯Worker线程 workerInstance.terminate(); ``` - 在Worker线程ä¸é€šè¿‡è°ƒç”¨[close()](../reference/apis/js-apis-worker.md#close9)方法主动销æ¯Worker线程,并终æ¢Worker接收消æ¯ã€‚ + æ–¹å¼äºŒï¼šåœ¨Worker线程ä¸é€šè¿‡è°ƒç”¨[close()](../reference/apis/js-apis-worker.md#close9)方法主动销æ¯Worker线程,并终æ¢Worker接收消æ¯ã€‚ ```js // 销æ¯çº¿ç¨‹