update issue template

pull/1059/head
Darien Raymond 2018-04-14 09:59:30 +02:00
parent ea262bc1bf
commit 320e1554bd
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
2 changed files with 19 additions and 0 deletions

View File

@ -43,6 +43,14 @@ Please skip to the English section below if you don't write Chinese.
8) 其它相关的配置文件(如 Nginx和相关日志。
9) 如果 V2Ray 无法启动,请附上 `--test` 输出。
通常的命令为 `/usr/bin/v2ray/v2ray --test --config /etc/v2ray/config.json`。请按实际情况修改。
10) 如果 V2Ray 服务运行不正常,请附上 journal 日志。
通常的命令为 `journalctl -u v2ray`。
请预览一下你填的内容再提交。
如果你已经填完上面的问卷,请把下面的英文部份删除,再提交 Issue。
@ -92,3 +100,10 @@ Please review your issue before submitting.
8) Other configurations (such as Nginx) and logs.
9) If V2Ray doesn't run, please attach output from `--test`.
The command is usually `/usr/bin/v2ray/v2ray --test --config /etc/v2ray/config.json`, but may vary according to your scenario.
10) If V2Ray service doesn't run, please attach journal log.
Usual command is `journalctl -u v2ray`.

View File

@ -1,9 +1,11 @@
package signal
// Semaphore is an implementation of semaphore.
type Semaphore struct {
token chan struct{}
}
// NewSemaphore create a new Semaphore with n permits.
func NewSemaphore(n int) *Semaphore {
s := &Semaphore{
token: make(chan struct{}, n),
@ -14,10 +16,12 @@ func NewSemaphore(n int) *Semaphore {
return s
}
// Wait returns a channel for acquiring a permit.
func (s *Semaphore) Wait() <-chan struct{} {
return s.token
}
// Signal releases a permit into the Semaphore.
func (s *Semaphore) Signal() {
s.token <- struct{}{}
}