func TestLowThreadLocking(t *testing.T) {
	if testing.Short() {
		t.SkipNow()
	}
	value := 0
	safeLock := New(time.Second, 1)
	outerID := safeLock.Lock()
	go func() {
		innerID := safeLock.Lock()
		defer safeLock.Unlock(innerID)
		if value != 1 {
			t.Fatal("Lock was grabbed incorrectly")
		}
	}()
	value = 1
	safeLock.Unlock(outerID)
}
TestLowThreadLocking checks that locks are functional in the safelock
mechanism, only 2 threads are used to try and trigger a race condition.
package sync
import (
	"runtime"
	"sync"
	"testing"
	"time"
)