- Sort Score
- Result 10 results
- Languages All
Results 1 - 1 of 1 for HammerMutex (0.1 sec)
-
src/sync/mutex_test.go
*s = 1 c := make(chan bool) defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(2)) b.StartTimer() go HammerSemaphore(s, b.N/2, c) go HammerSemaphore(s, b.N/2, c) <-c <-c } func HammerMutex(m *Mutex, loops int, cdone chan bool) { for i := 0; i < loops; i++ { if i%3 == 0 { if m.TryLock() { m.Unlock() } continue } m.Lock() m.Unlock() } cdone <- true }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Jun 16 21:25:35 UTC 2022 - 5.9K bytes - Viewed (0)