testflock: Use just sync.Mutex on browsers (#615)

This commit is contained in:
Hajime Hoshi 2018-05-19 21:10:34 +09:00
parent 0637a812bc
commit 81a1fd4744
2 changed files with 33 additions and 0 deletions

View File

@ -0,0 +1,31 @@
// Copyright 2018 The Ebiten Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// +build js
package testflock
import (
"sync"
)
var theLock sync.Mutex
func Lock() {
theLock.Lock()
}
func Unlock() {
theLock.Unlock()
}

View File

@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
// +build !js
// Package testflock provides a lock for testing. // Package testflock provides a lock for testing.
// //
// There is a CI service like TravisCI where multiple OpenGL processes // There is a CI service like TravisCI where multiple OpenGL processes