From 320e1554bd14a5194c0986d446cd76100c9e9d1d Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Sat, 14 Apr 2018 09:59:30 +0200 Subject: [PATCH] update issue template --- .github/ISSUE_TEMPLATE | 15 +++++++++++++++ common/signal/semaphore.go | 4 ++++ 2 files changed, 19 insertions(+) diff --git a/.github/ISSUE_TEMPLATE b/.github/ISSUE_TEMPLATE index 9b35768ad..096929192 100644 --- a/.github/ISSUE_TEMPLATE +++ b/.github/ISSUE_TEMPLATE @@ -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`. diff --git a/common/signal/semaphore.go b/common/signal/semaphore.go index f9a80db5b..362bd39bc 100644 --- a/common/signal/semaphore.go +++ b/common/signal/semaphore.go @@ -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{}{} }