Skip to content

Commit

Permalink
fix doc
Browse files Browse the repository at this point in the history
  • Loading branch information
fawdlstty committed May 19, 2022
1 parent 9f1af86 commit 31a8b9e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions docs/en_us/6_Other.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Asynchronous mutex is a mutex suitable for asynchronous environments. In contras
Create mutex

```cpp
AsyncMutex _mtx {}; // Pass the true argument to lock during initialization
fv::AsyncMutex _mtx {}; // Pass the true argument to lock during initialization
```

Lock:
Expand All @@ -48,7 +48,7 @@ _mtx.Unlock ();
To know if it is locked:

```cpp
_mtx.IsLocked ();
bool _locked = _mtx.IsLocked ();
```

## Asynchronous semaphore
Expand All @@ -60,7 +60,7 @@ An asynchronous semaphore is a semaphore suitable for asynchrony. In contrast t
Create semaphore:

```cpp
AsyncSemaphore _sema { 1 }; // Parameter means the initial number of resources
fv::AsyncSemaphore _sema { 1 }; // Parameter means the initial number of resources
```
Acquire resources:
Expand All @@ -85,5 +85,5 @@ _mtx.Release ();
Get the count of available resources:

```cpp
_mtx.GetResCount ();
size_t _count = _mtx.GetResCount ();
```
8 changes: 4 additions & 4 deletions docs/zh_hans/6_Other.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ boost::asio::io_context &_ctx = fv::Tasks::GetContext ();
创建锁:

```cpp
AsyncMutex _mtx {}; // 参数传 true 代表初始化时加锁
fv::AsyncMutex _mtx {}; // 参数传 true 代表初始化时加锁
```

加锁:
Expand All @@ -48,7 +48,7 @@ _mtx.Unlock ();
获知是否已锁:

```cpp
_mtx.IsLocked ();
bool _locked = _mtx.IsLocked ();
```

## 异步信号量
Expand All @@ -60,7 +60,7 @@ _mtx.IsLocked ();
创建信号量:

```cpp
AsyncSemaphore _sema { 1 }; // 参数代表初始资源数
fv::AsyncSemaphore _sema { 1 }; // 参数代表初始资源数
```
获取资源:
Expand All @@ -85,5 +85,5 @@ _mtx.Release ();
获知现有资源数:

```cpp
_mtx.GetResCount ();
size_t _count = _mtx.GetResCount ();
```

0 comments on commit 31a8b9e

Please sign in to comment.