diff --git a/compiler/natives/src/sync/pool.go b/compiler/natives/src/sync/pool.go index 629010d9e..2eef82bc9 100644 --- a/compiler/natives/src/sync/pool.go +++ b/compiler/natives/src/sync/pool.go @@ -8,6 +8,9 @@ type Pool struct { local unsafe.Pointer localSize uintptr + victim unsafe.Pointer + victimSize uintptr + store []interface{} New func() interface{} } diff --git a/compiler/natives/src/sync/sync.go b/compiler/natives/src/sync/sync.go index 2ae46e0a6..59dc2c32a 100644 --- a/compiler/natives/src/sync/sync.go +++ b/compiler/natives/src/sync/sync.go @@ -18,13 +18,14 @@ var semWaiters = make(map[*uint32][]chan bool) var semAwoken = make(map[*uint32]uint32) func runtime_Semacquire(s *uint32) { - runtime_SemacquireMutex(s, false) + runtime_SemacquireMutex(s, false, 0) } // SemacquireMutex is like Semacquire, but for profiling contended Mutexes. // Mutex profiling is not supported, so just use the same implementation as runtime_Semacquire. // TODO: Investigate this. If it's possible to implement, consider doing so, otherwise remove this comment. -func runtime_SemacquireMutex(s *uint32, lifo bool) { +func runtime_SemacquireMutex(s *uint32, lifo bool, skipframes int) { + // TODO: Use skipframes if needed/possible. if (*s - semAwoken[s]) == 0 { ch := make(chan bool) if lifo { @@ -41,8 +42,8 @@ func runtime_SemacquireMutex(s *uint32, lifo bool) { *s-- } -func runtime_Semrelease(s *uint32, handoff bool) { - // TODO: Use handoff if needed/possible. +func runtime_Semrelease(s *uint32, handoff bool, skipframes int) { + // TODO: Use handoff, skipframes if needed/possible. *s++ w := semWaiters[s]