mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 03:38:55 +01:00
testflock: Use just sync.Mutex on browsers (#615)
This commit is contained in:
parent
0637a812bc
commit
81a1fd4744
31
internal/testflock/flock_js.go
Normal file
31
internal/testflock/flock_js.go
Normal 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()
|
||||||
|
}
|
@ -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
|
Loading…
Reference in New Issue
Block a user