Remove internal/sync

nosync package for GopherJS is problematic since nosync's mutex
assumes that Lock call is never duplicated, which is not true in
actual applications.

See also #603.
This commit is contained in:
Hajime Hoshi 2018-05-09 23:41:06 +09:00
parent df048d9bf6
commit 92631e64ed
6 changed files with 4 additions and 63 deletions

View File

@ -19,10 +19,10 @@ package inpututil
import (
"sort"
"sync"
"github.com/hajimehoshi/ebiten"
"github.com/hajimehoshi/ebiten/internal/hooks"
"github.com/hajimehoshi/ebiten/internal/sync"
)
type inputState struct {

View File

@ -25,9 +25,8 @@
package clock
import (
"sync"
"time"
"github.com/hajimehoshi/ebiten/internal/sync"
)
const FPS = 60

View File

@ -19,13 +19,13 @@ import (
"image"
"image/color"
"runtime"
"sync"
"github.com/hajimehoshi/ebiten/internal/affine"
"github.com/hajimehoshi/ebiten/internal/graphics"
"github.com/hajimehoshi/ebiten/internal/opengl"
"github.com/hajimehoshi/ebiten/internal/packing"
"github.com/hajimehoshi/ebiten/internal/restorable"
"github.com/hajimehoshi/ebiten/internal/sync"
)
type backend struct {

View File

@ -1,29 +0,0 @@
// Copyright 2017 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 sync
import (
"github.com/gopherjs/gopherjs/nosync"
)
type Mutex struct {
nosync.Mutex
}
type RWMutex struct {
nosync.RWMutex
}

View File

@ -1,29 +0,0 @@
// Copyright 2017 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 sync
import (
"sync"
)
type Mutex struct {
sync.Mutex
}
type RWMutex struct {
sync.RWMutex
}

View File

@ -21,12 +21,12 @@ import (
"image"
"image/color"
"math"
"sync"
"golang.org/x/image/font"
"golang.org/x/image/math/fixed"
"github.com/hajimehoshi/ebiten"
"github.com/hajimehoshi/ebiten/internal/sync"
)
var (