You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: sync.go
    path of file: ./repos/gopherjs/compiler/natives/src/sync
    
    the code of the file until where you have to start completion: //go:build js
// +build js

package sync

import (
	_ "unsafe" // For go:linkname

	"github.com/gopherjs/gopherjs/js"
)

var semWaiters = make(map[*uint32][]chan bool)

// semAwoken tracks the number of waiters awoken by runtime_Semrelease (`ch <- true`)
// that have not yet acquired the semaphore (`<-ch` in
    
func runtime_SemacquireMutex(s *uint32, lifo bool, skipframes int) {
	if (*s - semAwoken[s]) == 0 {
		ch := make(chan bool)
		if lifo {
			semWaiters[s] = append([]chan bool{ch}, semWaiters[s]...)
		} else {
			semWaiters[s] = append(semWaiters[s], ch)
		}
		<-ch
		semAwoken[s] -= 1
		if semAwoken[s] == 0 {
			delete(semAwoken, s)
		}
	}
	*s--
}