mirror of
https://github.com/jeremyd/ergo.git
synced 2026-07-28 17:58:15 -07:00
remove unnecessary indirection in semaphore
This commit is contained in:
@@ -10,8 +10,7 @@ import (
|
||||
|
||||
func TestTryAcquire(t *testing.T) {
|
||||
count := 3
|
||||
var sem Semaphore
|
||||
sem.Initialize(count)
|
||||
sem := NewSemaphore(count)
|
||||
|
||||
for i := 0; i < count; i++ {
|
||||
assertEqual(sem.TryAcquire(), true, t)
|
||||
@@ -24,8 +23,7 @@ func TestTryAcquire(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestAcquireWithTimeout(t *testing.T) {
|
||||
var sem Semaphore
|
||||
sem.Initialize(1)
|
||||
sem := NewSemaphore(1)
|
||||
|
||||
assertEqual(sem.TryAcquire(), true, t)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user