Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Unified Diff: mojo/public/go/system/impl/core_impl.go

Issue 795593004: Update mojo sdk to rev cc531b32182099a5a034a99daff35ed5d38a61c8 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More workarounds for MSVC Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/public/go/system/core.go ('k') | mojo/public/go/system/impl/mojo_types.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/go/system/impl/core_impl.go
diff --git a/mojo/public/go/system/impl/core_impl.go b/mojo/public/go/system/impl/core_impl.go
index 601ebd2fb26cb5ab2dba0321977844ac4fccbb24..2cce24f275b1353a5407bc494c8b1a5d02c55410 100644
--- a/mojo/public/go/system/impl/core_impl.go
+++ b/mojo/public/go/system/impl/core_impl.go
@@ -31,12 +31,32 @@ func (c *CoreImpl) Close(handle MojoHandle) MojoResult {
return (MojoResult)(C.MojoClose(handle.cType()))
}
-func (c *CoreImpl) Wait(handle MojoHandle, signal MojoHandleSignals, deadline MojoDeadline) MojoResult {
- return (MojoResult)(C.MojoWait(handle.cType(), signal.cType(), deadline.cType()))
+func (c *CoreImpl) Wait(handle MojoHandle, signal MojoHandleSignals, deadline MojoDeadline) (MojoResult, *MojoHandleSignalsState) {
+ var signal_states C.struct_MojoHandleSignalsState
+ result := C.MojoNewWait(handle.cType(), signal.cType(), deadline.cType(), &signal_states)
+ return MojoResult(result), &MojoHandleSignalsState{MojoHandleSignals(signal_states.satisfied_signals), MojoHandleSignals(signal_states.satisfiable_signals)}
}
-func (c *CoreImpl) WaitMany(handles []MojoHandle, signals []MojoHandleSignals, deadline MojoDeadline) MojoResult {
- return (MojoResult)(C.MojoWaitMany(cArrayMojoHandle(handles), cArrayMojoHandleSignals(signals), (C.uint32_t)(len(handles)), deadline.cType()))
+func (c *CoreImpl) WaitMany(handles []MojoHandle, signals []MojoHandleSignals, deadline MojoDeadline) (result MojoResult, index *uint32, state []MojoHandleSignalsState) {
+ // Set "-1" using the instructions from http://blog.golang.org/constants
+ cindex := ^C.uint32_t(0)
+ cstate := make([]C.struct_MojoHandleSignalsState, len(handles))
+
+ result = (MojoResult)(C.MojoNewWaitMany(cArrayMojoHandle(handles), cArrayMojoHandleSignals(signals), (C.uint32_t)(len(handles)), deadline.cType(), &cindex, &cstate[0]))
+
+ if uint32(cindex) < uint32(len(handles)) {
+ temp := uint32(cindex)
+ index = &temp
+ }
+
+ if result != MOJO_RESULT_INVALID_ARGUMENT && result != MOJO_RESULT_RESOURCE_EXHAUSTED {
+ state = make([]MojoHandleSignalsState, len(cstate))
+ for i, value := range cstate {
+ state[i] = NewMojoHandleSignalsState(value)
+ }
+ }
+
+ return
}
func (c *CoreImpl) CreateMessagePipe(opts *MessagePipeOptions) (MojoResult, MojoHandle, MojoHandle) {
« no previous file with comments | « mojo/public/go/system/core.go ('k') | mojo/public/go/system/impl/mojo_types.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698