Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 15 additions & 11 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,30 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
paths:
- "docs/**"
- ".github/workflows/static.yml"

# Allows you to run this workflow manually from the Actions tab
pull_request:
paths:
- "docs/**"
- ".github/workflows/static.yml"

workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
build:
runs-on: ubuntu-22.04
steps:
- name: Install
Expand All @@ -46,8 +42,16 @@ jobs:
- name: Upload artifact
uses: actions/upload-pages-artifact@v4
with:
# Upload entire repository
path: "docs/public"

deploy:
needs: build
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-22.04
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
6 changes: 3 additions & 3 deletions docs/docs.cn/信号与任务的取消.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,15 +264,15 @@ syncAwait(Task().setLazyLocal(signal.get()).via(ex));
1. CollectAny:CollectAny会将信号转发给所有子任务,如果收到取消信号,会抛出异常立即返回。
2. CollectAll:CollectAny会将信号转发给所有子任务,即使收到取消信号,自身依然会等待所有子任务执行完毕后正常返回。
3. Yield/SpinLock上锁:如果被取消,会抛出异常。目前暂不支持取消在调度器中排队的任务。
4. Future:返回值Try<T>中将包含异常。
4. Sleep: 依赖于调度器是否重写了虚函数`void schedule(Func func, Duration dur, uint64_t schedule_info, Slot *slot = nullptr)`,并正确实现了取消功能。如果未重写该函数,默认实现支持取消Sleep。
4. Future:返回值`Try<T>`中将包含异常。
5. Sleep: 依赖于调度器是否重写了虚函数`void schedule(Func func, Duration dur, uint64_t schedule_info, Slot *slot = nullptr)`,并正确实现了取消功能。如果未重写该函数,默认实现支持取消Sleep。

以下IO对象与函数暂未支持取消操作,有待后续完善。
1. Mutex
2. ConditionVariable
3. SharedMutex
4. Latch
6. CountingSemaphore
5. CountingSemaphore

### 自定义Awaiter如何支持取消

Expand Down
Loading