usual

package
v0.0.0-...-f86eec2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func A

func A(i int)

func AA

func AA(i int)

func GR_NoBufChan

func GR_NoBufChan()

*

  • 无buf的channel控制
  • @see
  • @param

func GR_SyncCond

func GR_SyncCond()

*

  • 代码逻辑释义 1.done 即互斥锁需要保护的条件变量。 2.read() 调用 Wait() 等待通知,直到 done 为 true。 3.write() 接收数据,接收完成后,将 done 置为 true,调用 Broadcast() 通知所有等待的协程。 4.write() 中的暂停了3s,一方面是模拟耗时,另一方面是确保前面的 3 个 read 协程都执行到 Wait(),处于等待状态。main 函数最后暂停了 2s,确保所有操作执行完毕。

func GR_SyncWaitGroup

func GR_SyncWaitGroup()

func T_wg

func T_wg()

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL