| Index: third_party/mojo/src/mojo/public/go/system/core.go
|
| diff --git a/third_party/mojo/src/mojo/public/go/system/core.go b/third_party/mojo/src/mojo/public/go/system/core.go
|
| index da6313e0be764076e2b69fa6fdaa5b181b290dfb..e1b8cd4d50a37ef40f7859e9f435e6122537902a 100644
|
| --- a/third_party/mojo/src/mojo/public/go/system/core.go
|
| +++ b/third_party/mojo/src/mojo/public/go/system/core.go
|
| @@ -9,7 +9,6 @@
|
| import "C"
|
| import (
|
| "reflect"
|
| - "sync"
|
| "unsafe"
|
| )
|
|
|
| @@ -58,21 +57,8 @@
|
|
|
| // coreImpl is an implementation of the Mojo system APIs.
|
| type coreImpl struct {
|
| - // Protects from making parallel non-blocking mojo cgo calls.
|
| - mu sync.Mutex
|
| }
|
|
|
| -// GetCore returns singleton instance of the Mojo system APIs implementation.
|
| -//
|
| -// The implementation uses cgo to call native mojo APIs implementation. Each cgo
|
| -// call uses a separate thread for execution. To limit the number of used
|
| -// threads all non-blocking system calls (i.e. all system calls except |Wait|
|
| -// and |WaitMany|) on this implementation and on handles returned by this
|
| -// implementation are protected by a mutex so that if you make two parallel
|
| -// system calls one will wait for another to finish before executing.
|
| -// However, |Wait| and |WaitMany| are not protected by a mutex and each parallel
|
| -// call will use a separate thread. To reduce number of threads used for |Wait|
|
| -// calls prefer to use |WaitMany|.
|
| func GetCore() Core {
|
| return &core
|
| }
|
| @@ -82,13 +68,10 @@
|
| }
|
|
|
| func (impl *coreImpl) AcquireNativeHandle(handle MojoHandle) UntypedHandle {
|
| - return &untypedHandleImpl{baseHandle{impl, handle}}
|
| + return &untypedHandleImpl{baseHandle{handle}}
|
| }
|
|
|
| func (impl *coreImpl) GetTimeTicksNow() MojoTimeTicks {
|
| - impl.mu.Lock()
|
| - defer impl.mu.Unlock()
|
| -
|
| return MojoTimeTicks(C.MojoGetTimeTicksNow())
|
| }
|
|
|
| @@ -125,9 +108,6 @@
|
| }
|
|
|
| func (impl *coreImpl) CreateDataPipe(opts *DataPipeOptions) (MojoResult, ProducerHandle, ConsumerHandle) {
|
| - impl.mu.Lock()
|
| - defer impl.mu.Unlock()
|
| -
|
| cParams := C.MallocCreateDataPipeParams()
|
| defer C.FreeCreateDataPipeParams(cParams)
|
| result := C.MojoCreateDataPipe(opts.cValue(cParams.opts), cParams.producer, cParams.consumer)
|
| @@ -137,9 +117,6 @@
|
| }
|
|
|
| func (impl *coreImpl) CreateMessagePipe(opts *MessagePipeOptions) (MojoResult, MessagePipeHandle, MessagePipeHandle) {
|
| - impl.mu.Lock()
|
| - defer impl.mu.Unlock()
|
| -
|
| cParams := C.MallocCreateMessagePipeParams()
|
| defer C.FreeCreateMessagePipeParams(cParams)
|
| result := C.MojoCreateMessagePipe(opts.cValue(cParams.opts), cParams.handle0, cParams.handle1)
|
| @@ -149,9 +126,6 @@
|
| }
|
|
|
| func (impl *coreImpl) CreateSharedBuffer(opts *SharedBufferOptions, numBytes uint64) (MojoResult, SharedBufferHandle) {
|
| - impl.mu.Lock()
|
| - defer impl.mu.Unlock()
|
| -
|
| cParams := C.MallocCreateSharedBufferParams()
|
| defer C.FreeCreateSharedBufferParams(cParams)
|
| result := C.MojoCreateSharedBuffer(opts.cValue(cParams.opts), C.uint64_t(numBytes), cParams.handle)
|
|
|