oh-arkruntime-thread-safety-audit

Audit ArkCompiler ETS code for thread-safety races from shared mutable static state.

31|6|Updated Jan 29, 2026
One-click install
npx skills add https://github.com/openharmonyinsight/openharmony-skills --skill oh-arkruntime-thread-safety-audit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: oh-arkruntime-thread-safety-audit
Source: https://github.com/openharmonyinsight/openharmony-skills/tree/main/skills/oh-arkruntime-thread-safety-audit
Command: npx skills add https://github.com/openharmonyinsight/openharmony-skills --skill oh-arkruntime-thread-safety-audit

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It helps you detect and correct thread-safety defects in ArkCompiler Runtime Core, preventing data races and inconsistent behavior under ArkTS-Sta concurrency.

Core Features & Use Cases

  • Static mutable state discovery: Identifies risky shared state patterns such as static fields, caches, registries, timers, and global singletons in ETS code.
  • Concurrency reachability analysis: Verifies whether the candidate state can be reached through concurrent entry points like taskpool and EAWorker.
  • Fix guidance and targeted validation: Proposes synchronization strategies (atomics, concurrent containers, mutex/lock-guarded invariants) and recommends focused concurrent/TSAN-aligned testing.

Quick Start

Ask the AI to audit a specific ArkTS-Sta stdlib or plugin ETS file for shared mutable static state and concurrency entry paths, then propose the safest fix and the most relevant concurrent test cases.

Frequently Asked Questions about oh-arkruntime-thread-safety-audit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find thread-safety races caused by shared mutable static state in ArkTS-Sta?

To find thread-safety races in ArkTS-Sta, audit ETS code for risky shared static state like global singletons and caches, then verify reachability through concurrent entry points like taskpool and EAWorker.

How do I audit ArkCompiler Runtime Core ETS code for concurrency reachability?

Audit concurrency reachability by scanning ETS stdlib and plugin code for static candidates, then checking if taskpool, EAWorker, or callback paths can reach that shared state to classify race risks.

What is the best way to fix data races in ArkTS-Sta ETS stdlib and plugin code?

The best way to fix data races is applying synchronization strategies like atomics, concurrent containers, or mutex lock-guarded invariants, followed by running targeted TSAN-aligned concurrent tests for validation.

Can I use this thread-safety audit for native code in static_core/plugins/ets?

This thread-safety audit targets ETS code in static_core/plugins/ets, including stdlib and tests, applying native follow-up only when needed after completing the multi-phase ETS scanning and risk classification.

When do I need atomic synchronization or mutex invariants for ArkTS-Sta concurrency?

You need atomic synchronization or mutex invariants when shared mutable static state in ETS code is reachable via concurrent paths, requiring risk classification before proposing changes and validation tests.

Why does shared mutable static state cause data races under ArkTS-Sta concurrency?

Shared mutable static state causes data races under ArkTS-Sta concurrency when global registries or singletons are accessed simultaneously through taskpool or EAWorker paths without atomic or mutex synchronization.