Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 15 for netpollBreak (0.18 sec)

  1. src/runtime/netpoll_epoll.go

    	"internal/runtime/syscall"
    	"unsafe"
    )
    
    var (
    	epfd           int32         = -1 // epoll descriptor
    	netpollEventFd uintptr            // eventfd for netpollBreak
    	netpollWakeSig atomic.Uint32      // used to avoid duplicate calls of netpollBreak
    )
    
    func netpollinit() {
    	var errno uintptr
    	epfd, errno = syscall.EpollCreate1(syscall.EPOLL_CLOEXEC)
    	if errno != 0 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:53:03 UTC 2024
    - 4.6K bytes
    - Viewed (0)
  2. src/runtime/netpoll_aix.go

    	unlock(&mtxpoll)
    
    	switch mode {
    	case 'r':
    		pfds[pd.user].events |= _POLLIN
    	case 'w':
    		pfds[pd.user].events |= _POLLOUT
    	}
    	unlock(&mtxset)
    }
    
    // netpollBreak interrupts a poll.
    func netpollBreak() {
    	// Failing to cas indicates there is an in-flight wakeup, so we're done here.
    	if !netpollWakeSig.CompareAndSwap(0, 1) {
    		return
    	}
    
    	b := [1]byte{0}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:53:03 UTC 2024
    - 5.1K bytes
    - Viewed (0)
  3. src/runtime/netpoll_kqueue_pipe.go

    	for {
    		var b byte
    		n := write(netpollBreakWr, unsafe.Pointer(&b), 1)
    		if n == 1 || n == -_EAGAIN {
    			break
    		}
    		if n == -_EINTR {
    			continue
    		}
    		println("runtime: netpollBreak write failed with", -n)
    		throw("runtime: netpollBreak write failed")
    	}
    }
    
    func isWakeup(ev *keventt) bool {
    	if uintptr(ev.ident) == netpollBreakRd {
    		if ev.filter == _EVFILT_READ {
    			return true
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 12 21:17:22 UTC 2024
    - 2.1K bytes
    - Viewed (0)
  4. src/runtime/netpoll_kqueue_event.go

    	for {
    		n := kevent(kq, &ev, 1, nil, 0, nil)
    		if n == 0 {
    			break
    		}
    		if n == -_EINTR {
    			// Check out the comment in addWakeupEvent.
    			continue
    		}
    		println("runtime: netpollBreak write failed with", -n)
    		throw("runtime: netpollBreak write failed")
    	}
    }
    
    func isWakeup(ev *keventt) bool {
    	if ev.filter == _EVFILT_USER {
    		if ev.ident == kqIdent {
    			return true
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 24 17:15:46 UTC 2024
    - 1.8K bytes
    - Viewed (0)
  5. src/runtime/netpoll_kqueue.go

    	// on fd will remove any kevents that reference the descriptor.
    	return 0
    }
    
    func netpollarm(pd *pollDesc, mode int) {
    	throw("runtime: unused")
    }
    
    // netpollBreak interrupts a kevent.
    func netpollBreak() {
    	// Failing to cas indicates there is an in-flight wakeup, so we're done here.
    	if !netpollWakeSig.CompareAndSwap(0, 1) {
    		return
    	}
    
    	wakeNetpoll(kq)
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 12 21:17:22 UTC 2024
    - 4.6K bytes
    - Viewed (0)
  6. src/runtime/netpoll_os_test.go

    func init() {
    	runtime.NetpollGenericInit()
    }
    
    func BenchmarkNetpollBreak(b *testing.B) {
    	b.StartTimer()
    	for i := 0; i < b.N; i++ {
    		for j := 0; j < 10; j++ {
    			wg.Add(1)
    			go func() {
    				runtime.NetpollBreak()
    				wg.Done()
    			}()
    		}
    	}
    	wg.Wait()
    	b.StopTimer()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Nov 17 23:34:11 UTC 2023
    - 520 bytes
    - Viewed (0)
  7. src/runtime/netpoll_windows.go

    	ov       *overlapped
    	internal uintptr
    	qty      uint32
    }
    
    var (
    	iocphandle uintptr = _INVALID_HANDLE_VALUE // completion port io handle
    
    	netpollWakeSig atomic.Uint32 // used to avoid duplicate calls of netpollBreak
    )
    
    func netpollinit() {
    	iocphandle = stdcall4(_CreateIoCompletionPort, _INVALID_HANDLE_VALUE, 0, 0, _DWORD_MAX)
    	if iocphandle == 0 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 26 19:58:28 UTC 2024
    - 9.4K bytes
    - Viewed (0)
  8. src/runtime/netpoll_solaris.go

    	case 'r':
    		netpollupdate(pd, _POLLIN, 0)
    	case 'w':
    		netpollupdate(pd, _POLLOUT, 0)
    	default:
    		throw("runtime: bad mode")
    	}
    	unlock(&pd.lock)
    }
    
    // netpollBreak interrupts a port_getn wait.
    func netpollBreak() {
    	// Failing to cas indicates there is an in-flight wakeup, so we're done here.
    	if !netpollWakeSig.CompareAndSwap(0, 1) {
    		return
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:53:03 UTC 2024
    - 11.2K bytes
    - Viewed (0)
  9. src/runtime/netpoll_fake.go

    	return false
    }
    
    func netpollopen(fd uintptr, pd *pollDesc) int32 {
    	return 0
    }
    
    func netpollclose(fd uintptr) int32 {
    	return 0
    }
    
    func netpollarm(pd *pollDesc, mode int) {
    }
    
    func netpollBreak() {
    }
    
    func netpoll(delay int64) (gList, int32) {
    	return gList{}, 0
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jul 20 15:45:57 UTC 2023
    - 664 bytes
    - Viewed (0)
  10. src/runtime/netpoll_stub.go

    // netpollBroken, protected by netpollBrokenLock, avoids a double notewakeup.
    var netpollBrokenLock mutex
    var netpollBroken bool
    
    func netpollGenericInit() {
    	netpollInited.Store(1)
    }
    
    func netpollBreak() {
    	lock(&netpollBrokenLock)
    	broken := netpollBroken
    	netpollBroken = true
    	if !broken {
    		notewakeup(&netpollNote)
    	}
    	unlock(&netpollBrokenLock)
    }
    
    // Polls for ready network connections.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:53:03 UTC 2024
    - 1.5K bytes
    - Viewed (0)
Back to top