Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for mock (0.2 sec)

  1. doc/go_mem.html

    var a string
    
    func f() {
    	a = "hello, world"
    	l.Unlock()
    }
    
    func main() {
    	l.Lock()
    	go f()
    	l.Lock()
    	print(a)
    }
    </pre>
    
    <p>
    is guaranteed to print <code>"hello, world"</code>.
    The first call to <code>l.Unlock()</code> (in <code>f</code>) is synchronized
    before the second call to <code>l.Lock()</code> (in <code>main</code>) returns,
    which is sequenced before the <code>print</code>.
    </p>
    
    HTML
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Mon Mar 04 15:54:42 GMT 2024
    - 26.6K bytes
    - Viewed (0)
Back to top