Source file src/runtime/net_plan9.go

     1  // Copyright 2016 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package runtime
     6  
     7  import (
     8  	_ "unsafe"
     9  )
    10  
    11  //go:linkname runtime_ignoreHangup internal/poll.runtime_ignoreHangup
    12  func runtime_ignoreHangup() {
    13  	getg().m.ignoreHangup = true
    14  }
    15  
    16  // A note is delivered at the next kernel exit, so sleep once for each
    17  // one Cancel posted, or it arrives when nothing ignores it any more.
    18  //
    19  //go:linkname runtime_unignoreHangup internal/poll.runtime_unignoreHangup
    20  func runtime_unignoreHangup(notes int) {
    21  	for ; notes > 0; notes-- {
    22  		sleep(0)
    23  	}
    24  	getg().m.ignoreHangup = false
    25  }
    26  
    27  func ignoredNote(note *byte) bool {
    28  	if note == nil {
    29  		return false
    30  	}
    31  	if gostringnocopy(note) != "hangup" {
    32  		return false
    33  	}
    34  	return getg().m.ignoreHangup
    35  }
    36  

View as plain text