X7ROOT File Manager
Current Path:
/opt/golang/1.22.0/src/runtime
opt
/
golang
/
1.22.0
/
src
/
runtime
/
π
..
π
HACKING.md
(13.85 KB)
π
Makefile
(178 B)
π
abi_test.go
(2.83 KB)
π
alg.go
(10.99 KB)
π
align_runtime_test.go
(1.82 KB)
π
align_test.go
(5.37 KB)
π
arena.go
(31.66 KB)
π
arena_test.go
(13.39 KB)
π
asan
π
asan.go
(1.55 KB)
π
asan0.go
(760 B)
π
asan_amd64.s
(2.45 KB)
π
asan_arm64.s
(2.14 KB)
π
asan_loong64.s
(2.12 KB)
π
asan_ppc64le.s
(2.75 KB)
π
asan_riscv64.s
(1.92 KB)
π
asm.s
(719 B)
π
asm_386.s
(42.54 KB)
π
asm_amd64.h
(631 B)
π
asm_amd64.s
(60.09 KB)
π
asm_arm.s
(31.58 KB)
π
asm_arm64.s
(43.33 KB)
π
asm_loong64.s
(27.58 KB)
π
asm_mips64x.s
(24.34 KB)
π
asm_mipsx.s
(25.82 KB)
π
asm_ppc64x.h
(1.93 KB)
π
asm_ppc64x.s
(45.19 KB)
π
asm_riscv64.s
(26.97 KB)
π
asm_s390x.s
(27.55 KB)
π
asm_wasm.s
(11.82 KB)
π
atomic_arm64.s
(259 B)
π
atomic_loong64.s
(245 B)
π
atomic_mips64x.s
(300 B)
π
atomic_mipsx.s
(262 B)
π
atomic_pointer.go
(3.66 KB)
π
atomic_ppc64x.s
(437 B)
π
atomic_riscv64.s
(275 B)
π
auxv_none.go
(298 B)
π
callers_test.go
(12.13 KB)
π
cgo
π
cgo.go
(2.5 KB)
π
cgo_mmap.go
(2.42 KB)
π
cgo_ppc64x.go
(418 B)
π
cgo_sigaction.go
(3.28 KB)
π
cgocall.go
(23.23 KB)
π
cgocallback.go
(317 B)
π
cgocheck.go
(7.97 KB)
π
chan.go
(23.74 KB)
π
chan_test.go
(23.44 KB)
π
chanbarrier_test.go
(1.4 KB)
π
checkptr.go
(3.29 KB)
π
checkptr_test.go
(2.86 KB)
π
closure_test.go
(937 B)
π
compiler.go
(410 B)
π
complex.go
(1.59 KB)
π
complex_test.go
(1.05 KB)
π
conv_wasm_test.go
(2.96 KB)
π
coro.go
(4.92 KB)
π
coverage
π
covercounter.go
(749 B)
π
covermeta.go
(2.4 KB)
π
cpuflags.go
(810 B)
π
cpuflags_amd64.go
(533 B)
π
cpuflags_arm64.go
(312 B)
π
cpuprof.go
(7.94 KB)
π
cputicks.go
(437 B)
π
crash_cgo_test.go
(23.35 KB)
π
crash_test.go
(23.12 KB)
π
crash_unix_test.go
(9.19 KB)
π
create_file_nounix.go
(305 B)
π
create_file_unix.go
(368 B)
π
debug
π
debug.go
(3.53 KB)
π
debug_test.go
(7.99 KB)
π
debugcall.go
(6.75 KB)
π
debuglog.go
(18.24 KB)
π
debuglog_off.go
(357 B)
π
debuglog_on.go
(1.09 KB)
π
debuglog_test.go
(4.9 KB)
π
defer_test.go
(11.4 KB)
π
defs1_linux.go
(845 B)
π
defs1_netbsd_386.go
(2.91 KB)
π
defs1_netbsd_amd64.go
(3.14 KB)
π
defs1_netbsd_arm.go
(3.03 KB)
π
defs1_netbsd_arm64.go
(3.25 KB)
π
defs1_solaris_amd64.go
(4.01 KB)
π
defs2_linux.go
(3.22 KB)
π
defs3_linux.go
(1.09 KB)
π
defs_aix.go
(4.17 KB)
π
defs_aix_ppc64.go
(3.63 KB)
π
defs_arm_linux.go
(2.67 KB)
π
defs_darwin.go
(4.18 KB)
π
defs_darwin_amd64.go
(6.34 KB)
π
defs_darwin_arm64.go
(4.17 KB)
π
defs_dragonfly.go
(2.73 KB)
π
defs_dragonfly_amd64.go
(3.41 KB)
π
defs_freebsd.go
(3.96 KB)
π
defs_freebsd_386.go
(4.52 KB)
π
defs_freebsd_amd64.go
(4.79 KB)
π
defs_freebsd_arm.go
(3.92 KB)
π
defs_freebsd_arm64.go
(4.18 KB)
π
defs_freebsd_riscv64.go
(4.19 KB)
π
defs_illumos_amd64.go
(285 B)
π
defs_linux.go
(2.92 KB)
π
defs_linux_386.go
(4.2 KB)
π
defs_linux_amd64.go
(4.7 KB)
π
defs_linux_arm.go
(3.89 KB)
π
defs_linux_arm64.go
(3.62 KB)
π
defs_linux_loong64.go
(3.43 KB)
π
defs_linux_mips64x.go
(3.6 KB)
π
defs_linux_mipsx.go
(3.6 KB)
π
defs_linux_ppc64.go
(3.69 KB)
π
defs_linux_ppc64le.go
(3.69 KB)
π
defs_linux_riscv64.go
(3.81 KB)
π
defs_linux_s390x.go
(3.16 KB)
π
defs_netbsd.go
(2.83 KB)
π
defs_netbsd_386.go
(855 B)
π
defs_netbsd_amd64.go
(1.01 KB)
π
defs_netbsd_arm.go
(764 B)
π
defs_openbsd.go
(3.06 KB)
π
defs_openbsd_386.go
(2.91 KB)
π
defs_openbsd_amd64.go
(3.11 KB)
π
defs_openbsd_arm.go
(3.03 KB)
π
defs_openbsd_arm64.go
(2.78 KB)
π
defs_openbsd_mips64.go
(2.75 KB)
π
defs_openbsd_ppc64.go
(3 KB)
π
defs_openbsd_riscv64.go
(2.89 KB)
π
defs_plan9_386.go
(1.63 KB)
π
defs_plan9_amd64.go
(1.82 KB)
π
defs_plan9_arm.go
(1.73 KB)
π
defs_solaris.go
(3.32 KB)
π
defs_solaris_amd64.go
(1004 B)
π
defs_windows.go
(2.25 KB)
π
defs_windows_386.go
(2.28 KB)
π
defs_windows_amd64.go
(3.19 KB)
π
defs_windows_arm.go
(2.57 KB)
π
defs_windows_arm64.go
(3.07 KB)
π
duff_386.s
(8.24 KB)
π
duff_amd64.s
(5.64 KB)
π
duff_arm.s
(7.11 KB)
π
duff_arm64.s
(5.27 KB)
π
duff_loong64.s
(11.9 KB)
π
duff_mips64x.s
(11.28 KB)
π
duff_ppc64x.s
(7.06 KB)
π
duff_riscv64.s
(11.4 KB)
π
duff_s390x.s
(507 B)
π
ehooks_test.go
(2.04 KB)
π
env_plan9.go
(3 KB)
π
env_posix.go
(1.56 KB)
π
env_test.go
(1.16 KB)
π
error.go
(9.29 KB)
π
example_test.go
(1.55 KB)
π
exithook.go
(2.32 KB)
π
export_aix_test.go
(207 B)
π
export_arm_test.go
(226 B)
π
export_darwin_test.go
(207 B)
π
export_debug_amd64_test.go
(3.6 KB)
π
export_debug_arm64_test.go
(3.49 KB)
π
export_debug_ppc64le_test.go
(3.5 KB)
π
export_debug_test.go
(5.07 KB)
π
export_debuglog_test.go
(1.27 KB)
π
export_linux_test.go
(378 B)
π
export_mmap_test.go
(429 B)
π
export_pipe2_test.go
(310 B)
π
export_pipe_test.go
(219 B)
π
export_test.go
(50.52 KB)
π
export_unix_test.go
(2.27 KB)
π
export_windows_test.go
(903 B)
π
extern.go
(18.58 KB)
π
fastlog2.go
(1.22 KB)
π
fastlog2_test.go
(784 B)
π
fastlog2table.go
(904 B)
π
fds_nonunix.go
(256 B)
π
fds_test.go
(1.43 KB)
π
fds_unix.go
(1.27 KB)
π
float.go
(1.35 KB)
π
float_test.go
(699 B)
π
funcdata.h
(2.53 KB)
π
gc_test.go
(20.32 KB)
π
gcinfo_test.go
(5.95 KB)
π
go_tls.h
(366 B)
π
hash32.go
(1.58 KB)
π
hash64.go
(1.95 KB)
π
hash_test.go
(17.24 KB)
π
heap_test.go
(529 B)
π
heapdump.go
(17.88 KB)
π
histogram.go
(7.3 KB)
π
histogram_test.go
(3.51 KB)
π
iface.go
(20.92 KB)
π
iface_test.go
(7.45 KB)
π
import_test.go
(1.42 KB)
π
importx_test.go
(763 B)
π
internal
π
lfstack.go
(2.03 KB)
π
lfstack_test.go
(2.74 KB)
π
libfuzzer.go
(6.34 KB)
π
libfuzzer_amd64.s
(5.03 KB)
π
libfuzzer_arm64.s
(3.15 KB)
π
lock_futex.go
(5.4 KB)
π
lock_js.go
(7.28 KB)
π
lock_sema.go
(6.75 KB)
π
lock_wasip1.go
(2.01 KB)
π
lockrank.go
(18.19 KB)
π
lockrank_off.go
(1.17 KB)
π
lockrank_on.go
(10.27 KB)
π
lockrank_test.go
(856 B)
π
malloc.go
(58.5 KB)
π
malloc_test.go
(10.64 KB)
π
map.go
(52.17 KB)
π
map_benchmark_test.go
(10.59 KB)
π
map_fast32.go
(12.74 KB)
π
map_fast64.go
(12.92 KB)
π
map_faststr.go
(14.32 KB)
π
map_test.go
(31.75 KB)
π
mbarrier.go
(13.78 KB)
π
mbitmap.go
(22.54 KB)
π
mbitmap_allocheaders.go
(44.67 KB)
π
mbitmap_noallocheaders.go
(28.95 KB)
π
mcache.go
(10 KB)
π
mcentral.go
(8.05 KB)
π
mcheckmark.go
(2.85 KB)
π
mem.go
(6.72 KB)
π
mem_aix.go
(2.01 KB)
π
mem_bsd.go
(2.21 KB)
π
mem_darwin.go
(1.96 KB)
π
mem_js.go
(457 B)
π
mem_linux.go
(4.98 KB)
π
mem_plan9.go
(447 B)
π
mem_sbrk.go
(4.19 KB)
π
mem_wasip1.go
(392 B)
π
mem_wasm.go
(488 B)
π
mem_windows.go
(3.88 KB)
π
memclr_386.s
(2.38 KB)
π
memclr_amd64.s
(4.91 KB)
π
memclr_arm.s
(2.6 KB)
π
memclr_arm64.s
(3.62 KB)
π
memclr_loong64.s
(843 B)
π
memclr_mips64x.s
(1.72 KB)
π
memclr_mipsx.s
(1.32 KB)
π
memclr_plan9_386.s
(983 B)
π
memclr_plan9_amd64.s
(511 B)
π
memclr_ppc64x.s
(4.44 KB)
π
memclr_riscv64.s
(1.71 KB)
π
memclr_s390x.s
(1.96 KB)
π
memclr_wasm.s
(485 B)
π
memmove_386.s
(4.42 KB)
π
memmove_amd64.s
(12.48 KB)
π
memmove_arm.s
(5.9 KB)
π
memmove_arm64.s
(5.96 KB)
π
memmove_linux_amd64_test.go
(1.53 KB)
π
memmove_loong64.s
(1.87 KB)
π
memmove_mips64x.s
(1.83 KB)
π
memmove_mipsx.s
(4.4 KB)
π
memmove_plan9_386.s
(3.06 KB)
π
memmove_plan9_amd64.s
(3.04 KB)
π
memmove_ppc64x.s
(4.91 KB)
π
memmove_riscv64.s
(5.46 KB)
π
memmove_s390x.s
(2.92 KB)
π
memmove_test.go
(21.23 KB)
π
memmove_wasm.s
(479 B)
π
metrics
π
metrics.go
(26.01 KB)
π
metrics_test.go
(42.46 KB)
π
mfinal.go
(18.91 KB)
π
mfinal_test.go
(5.57 KB)
π
mfixalloc.go
(3.13 KB)
π
mgc.go
(59.29 KB)
π
mgclimit.go
(17.28 KB)
π
mgclimit_test.go
(9.02 KB)
π
mgcmark.go
(53.07 KB)
π
mgcpacer.go
(55.36 KB)
π
mgcpacer_test.go
(39.26 KB)
π
mgcscavenge.go
(52.32 KB)
π
mgcscavenge_test.go
(25.2 KB)
π
mgcstack.go
(10.58 KB)
π
mgcsweep.go
(32.26 KB)
π
mgcwork.go
(12.89 KB)
π
mheap.go
(72.64 KB)
π
minmax.go
(1.46 KB)
π
minmax_test.go
(3.31 KB)
π
mkduff.go
(8.04 KB)
π
mkfastlog2table.go
(3.08 KB)
π
mklockrank.go
(9 KB)
π
mkpreempt.go
(15.33 KB)
π
mksizeclasses.go
(9.52 KB)
π
mmap.go
(844 B)
π
mpagealloc.go
(39.23 KB)
π
mpagealloc_32bit.go
(4.56 KB)
π
mpagealloc_64bit.go
(9.34 KB)
π
mpagealloc_test.go
(32.59 KB)
π
mpagecache.go
(5.59 KB)
π
mpagecache_test.go
(10.79 KB)
π
mpallocbits.go
(12.58 KB)
π
mpallocbits_test.go
(13.69 KB)
π
mprof.go
(47.4 KB)
π
mranges.go
(14.46 KB)
π
mranges_test.go
(5.68 KB)
π
msan
π
msan.go
(1.5 KB)
π
msan0.go
(725 B)
π
msan_amd64.s
(2.3 KB)
π
msan_arm64.s
(1.98 KB)
π
msan_loong64.s
(1.96 KB)
π
msize_allocheaders.go
(1.32 KB)
π
msize_noallocheaders.go
(915 B)
π
mspanset.go
(13.12 KB)
π
mstats.go
(33.81 KB)
π
mwbbuf.go
(8.13 KB)
π
nbpipe_pipe.go
(405 B)
π
nbpipe_pipe2.go
(344 B)
π
nbpipe_pipe_test.go
(706 B)
π
nbpipe_test.go
(1.99 KB)
π
net_plan9.go
(645 B)
π
netpoll.go
(20.55 KB)
π
netpoll_aix.go
(5.06 KB)
π
netpoll_epoll.go
(4.4 KB)
π
netpoll_fake.go
(664 B)
π
netpoll_kqueue.go
(5.62 KB)
π
netpoll_os_test.go
(520 B)
π
netpoll_solaris.go
(11.2 KB)
π
netpoll_stub.go
(1.48 KB)
π
netpoll_wasip1.go
(6.08 KB)
π
netpoll_windows.go
(4.01 KB)
π
nonwindows_stub.go
(729 B)
π
norace_linux_test.go
(915 B)
π
norace_test.go
(983 B)
π
numcpu_freebsd_test.go
(381 B)
π
os2_aix.go
(20.88 KB)
π
os2_freebsd.go
(302 B)
π
os2_openbsd.go
(296 B)
π
os2_plan9.go
(1.48 KB)
π
os2_solaris.go
(320 B)
π
os3_plan9.go
(3.94 KB)
π
os3_solaris.go
(17.59 KB)
π
os_aix.go
(8.89 KB)
π
os_android.go
(463 B)
π
os_darwin.go
(11.92 KB)
π
os_darwin_arm64.go
(329 B)
π
os_dragonfly.go
(7.14 KB)
π
os_freebsd.go
(11.64 KB)
π
os_freebsd2.go
(603 B)
π
os_freebsd_amd64.go
(658 B)
π
os_freebsd_arm.go
(1.45 KB)
π
os_freebsd_arm64.go
(320 B)
π
os_freebsd_noauxv.go
(241 B)
π
os_freebsd_riscv64.go
(198 B)
π
os_illumos.go
(3.93 KB)
π
os_js.go
(767 B)
π
os_linux.go
(25.71 KB)
π
os_linux_arm.go
(1.51 KB)
π
os_linux_arm64.go
(478 B)
π
os_linux_be64.go
(806 B)
π
os_linux_generic.go
(870 B)
π
os_linux_loong64.go
(263 B)
π
os_linux_mips64x.go
(996 B)
π
os_linux_mipsx.go
(987 B)
π
os_linux_noauxv.go
(337 B)
π
os_linux_novdso.go
(347 B)
π
os_linux_ppc64x.go
(526 B)
π
os_linux_riscv64.go
(198 B)
π
os_linux_s390x.go
(825 B)
π
os_linux_x86.go
(234 B)
π
os_netbsd.go
(10.12 KB)
π
os_netbsd_386.go
(617 B)
π
os_netbsd_amd64.go
(614 B)
π
os_netbsd_arm.go
(1.07 KB)
π
os_netbsd_arm64.go
(769 B)
π
os_nonopenbsd.go
(437 B)
π
os_only_solaris.go
(357 B)
π
os_openbsd.go
(6.23 KB)
π
os_openbsd_arm.go
(662 B)
π
os_openbsd_arm64.go
(329 B)
π
os_openbsd_libc.go
(1.49 KB)
π
os_openbsd_mips64.go
(329 B)
π
os_openbsd_syscall.go
(1.36 KB)
π
os_openbsd_syscall1.go
(441 B)
π
os_openbsd_syscall2.go
(2.51 KB)
π
os_plan9.go
(10.18 KB)
π
os_plan9_arm.go
(375 B)
π
os_solaris.go
(6.62 KB)
π
os_unix.go
(436 B)
π
os_unix_nonlinux.go
(374 B)
π
os_wasip1.go
(7 KB)
π
os_wasm.go
(3.15 KB)
π
os_windows.go
(41.39 KB)
π
os_windows_arm.go
(511 B)
π
os_windows_arm64.go
(339 B)
π
pagetrace_off.go
(550 B)
π
pagetrace_on.go
(10.36 KB)
π
panic.go
(41.85 KB)
π
panic32.go
(4.8 KB)
π
panic_test.go
(1.71 KB)
π
panicnil_test.go
(1.25 KB)
π
pinner.go
(10.98 KB)
π
pinner_test.go
(11.04 KB)
π
plugin.go
(4.37 KB)
π
pprof
π
preempt.go
(15.03 KB)
π
preempt_386.s
(824 B)
π
preempt_amd64.s
(1.67 KB)
π
preempt_arm.s
(1.49 KB)
π
preempt_arm64.s
(1.97 KB)
π
preempt_loong64.s
(2.41 KB)
π
preempt_mips64x.s
(2.72 KB)
π
preempt_mipsx.s
(2.68 KB)
π
preempt_nonwindows.go
(290 B)
π
preempt_ppc64x.s
(2.72 KB)
π
preempt_riscv64.s
(2.26 KB)
π
preempt_s390x.s
(1.01 KB)
π
preempt_wasm.s
(176 B)
π
print.go
(5.92 KB)
π
proc.go
(204.28 KB)
π
proc_runtime_test.go
(1.38 KB)
π
proc_test.go
(25.85 KB)
π
profbuf.go
(18.26 KB)
π
profbuf_test.go
(8.54 KB)
π
proflabel.go
(1.52 KB)
π
race
π
race.go
(18.81 KB)
π
race0.go
(2.79 KB)
π
race_amd64.s
(13.94 KB)
π
race_arm64.s
(14.21 KB)
π
race_ppc64le.s
(15.93 KB)
π
race_s390x.s
(11.99 KB)
π
rand.go
(7.11 KB)
π
rand_test.go
(1.95 KB)
π
rdebug.go
(550 B)
π
retry.go
(760 B)
π
rt0_aix_ppc64.s
(4.09 KB)
π
rt0_android_386.s
(822 B)
π
rt0_android_amd64.s
(754 B)
π
rt0_android_arm.s
(843 B)
π
rt0_android_arm64.s
(941 B)
π
rt0_darwin_amd64.s
(399 B)
π
rt0_darwin_arm64.s
(1.69 KB)
π
rt0_dragonfly_amd64.s
(448 B)
π
rt0_freebsd_386.s
(454 B)
π
rt0_freebsd_amd64.s
(442 B)
π
rt0_freebsd_arm.s
(298 B)
π
rt0_freebsd_arm64.s
(1.88 KB)
π
rt0_freebsd_riscv64.s
(2.72 KB)
π
rt0_illumos_amd64.s
(311 B)
π
rt0_ios_amd64.s
(425 B)
π
rt0_ios_arm64.s
(425 B)
π
rt0_js_wasm.s
(1.53 KB)
π
rt0_linux_386.s
(450 B)
π
rt0_linux_amd64.s
(307 B)
π
rt0_linux_arm.s
(1007 B)
π
rt0_linux_arm64.s
(1.81 KB)
π
rt0_linux_loong64.s
(2.01 KB)
π
rt0_linux_mips64x.s
(1014 B)
π
rt0_linux_mipsx.s
(797 B)
π
rt0_linux_ppc64.s
(847 B)
π
rt0_linux_ppc64le.s
(2.89 KB)
π
rt0_linux_riscv64.s
(2.65 KB)
π
rt0_linux_s390x.s
(676 B)
π
rt0_netbsd_386.s
(452 B)
π
rt0_netbsd_amd64.s
(309 B)
π
rt0_netbsd_arm.s
(296 B)
π
rt0_netbsd_arm64.s
(1.8 KB)
π
rt0_openbsd_386.s
(454 B)
π
rt0_openbsd_amd64.s
(311 B)
π
rt0_openbsd_arm.s
(298 B)
π
rt0_openbsd_arm64.s
(1.96 KB)
π
rt0_openbsd_mips64.s
(976 B)
π
rt0_openbsd_ppc64.s
(370 B)
π
rt0_openbsd_riscv64.s
(372 B)
π
rt0_plan9_386.s
(523 B)
π
rt0_plan9_amd64.s
(481 B)
π
rt0_plan9_arm.s
(397 B)
π
rt0_solaris_amd64.s
(311 B)
π
rt0_wasip1_wasm.s
(387 B)
π
rt0_windows_386.s
(1.28 KB)
π
rt0_windows_amd64.s
(1.14 KB)
π
rt0_windows_arm.s
(386 B)
π
rt0_windows_arm64.s
(733 B)
π
runtime-gdb.py
(15.44 KB)
π
runtime-gdb_test.go
(24.04 KB)
π
runtime-gdb_unix_test.go
(9.4 KB)
π
runtime-lldb_test.go
(4.95 KB)
π
runtime-seh_windows_test.go
(4.7 KB)
π
runtime.go
(7.1 KB)
π
runtime1.go
(16.66 KB)
π
runtime2.go
(46.16 KB)
π
runtime_boring.go
(606 B)
π
runtime_linux_test.go
(1.77 KB)
π
runtime_mmap_test.go
(1.77 KB)
π
runtime_test.go
(11.81 KB)
π
runtime_unix_test.go
(1.22 KB)
π
rwmutex.go
(5 KB)
π
rwmutex_test.go
(4.21 KB)
π
security_aix.go
(449 B)
π
security_issetugid.go
(502 B)
π
security_linux.go
(335 B)
π
security_nonunix.go
(256 B)
π
security_test.go
(4.09 KB)
π
security_unix.go
(818 B)
π
select.go
(14.82 KB)
π
sema.go
(18.43 KB)
π
sema_test.go
(4.21 KB)
π
semasleep_test.go
(3.46 KB)
π
sigaction.go
(489 B)
π
signal_386.go
(1.72 KB)
π
signal_aix_ppc64.go
(3.54 KB)
π
signal_amd64.go
(2.73 KB)
π
signal_arm.go
(2.54 KB)
π
signal_arm64.go
(3.83 KB)
π
signal_darwin.go
(2.13 KB)
π
signal_darwin_amd64.go
(4 KB)
π
signal_darwin_arm64.go
(3.6 KB)
π
signal_dragonfly.go
(2.17 KB)
π
signal_dragonfly_amd64.go
(2.01 KB)
π
signal_freebsd.go
(2.2 KB)
π
signal_freebsd_386.go
(1.55 KB)
π
signal_freebsd_amd64.go
(2.03 KB)
π
signal_freebsd_arm.go
(2.18 KB)
π
signal_freebsd_arm64.go
(3.24 KB)
π
signal_freebsd_riscv64.go
(3.08 KB)
π
signal_linux_386.go
(1.59 KB)
π
signal_linux_amd64.go
(2.05 KB)
π
signal_linux_arm.go
(2.12 KB)
π
signal_linux_arm64.go
(2.95 KB)
π
signal_linux_loong64.go
(3.22 KB)
π
signal_linux_mips64x.go
(3.35 KB)
π
signal_linux_mipsx.go
(3.67 KB)
π
signal_linux_ppc64x.go
(3.5 KB)
π
signal_linux_riscv64.go
(2.92 KB)
π
signal_linux_s390x.go
(4.49 KB)
π
signal_loong64.go
(3.01 KB)
π
signal_mips64x.go
(3.18 KB)
π
signal_mipsx.go
(3.06 KB)
π
signal_netbsd.go
(2.18 KB)
π
signal_netbsd_386.go
(1.76 KB)
π
signal_netbsd_amd64.go
(2.33 KB)
π
signal_netbsd_arm.go
(2.3 KB)
π
signal_netbsd_arm64.go
(3.4 KB)
π
signal_openbsd.go
(2.18 KB)
π
signal_openbsd_386.go
(1.58 KB)
π
signal_openbsd_amd64.go
(2.04 KB)
π
signal_openbsd_arm.go
(2.12 KB)
π
signal_openbsd_arm64.go
(3.39 KB)
π
signal_openbsd_mips64.go
(3.28 KB)
π
signal_openbsd_ppc64.go
(3.53 KB)
π
signal_openbsd_riscv64.go
(3.12 KB)
π
signal_plan9.go
(1.93 KB)
π
signal_ppc64x.go
(3.71 KB)
π
signal_riscv64.go
(2.91 KB)
π
signal_solaris.go
(4.5 KB)
π
signal_solaris_amd64.go
(2.47 KB)
π
signal_unix.go
(44.11 KB)
π
signal_windows.go
(14.48 KB)
π
signal_windows_test.go
(8.98 KB)
π
sigqueue.go
(7.62 KB)
π
sigqueue_note.go
(648 B)
π
sigqueue_plan9.go
(3.25 KB)
π
sigtab_aix.go
(11.3 KB)
π
sigtab_linux_generic.go
(3.52 KB)
π
sigtab_linux_mipsx.go
(5.95 KB)
π
sizeclasses.go
(9.17 KB)
π
sizeof_test.go
(1003 B)
π
slice.go
(11.23 KB)
π
slice_test.go
(10.32 KB)
π
softfloat64.go
(11.54 KB)
π
softfloat64_test.go
(4.04 KB)
π
stack.go
(40.02 KB)
π
stack_test.go
(23.14 KB)
π
start_line_amd64_test.go
(647 B)
π
start_line_test.go
(2.58 KB)
π
stkframe.go
(9.88 KB)
π
string.go
(13.35 KB)
π
string_test.go
(13.33 KB)
π
stubs.go
(17.39 KB)
π
stubs2.go
(1.15 KB)
π
stubs3.go
(324 B)
π
stubs_386.go
(708 B)
π
stubs_amd64.go
(1.38 KB)
π
stubs_arm.go
(689 B)
π
stubs_arm64.go
(700 B)
π
stubs_linux.go
(650 B)
π
stubs_loong64.go
(638 B)
π
stubs_mips64x.go
(522 B)
π
stubs_mipsx.go
(441 B)
π
stubs_nonlinux.go
(298 B)
π
stubs_ppc64.go
(302 B)
π
stubs_ppc64x.go
(688 B)
π
stubs_riscv64.go
(695 B)
π
stubs_s390x.go
(414 B)
π
symtab.go
(34.76 KB)
π
symtab_test.go
(7.48 KB)
π
symtabinl.go
(3.81 KB)
π
symtabinl_test.go
(2.97 KB)
π
sys_aix_ppc64.s
(7.42 KB)
π
sys_arm.go
(521 B)
π
sys_arm64.go
(469 B)
π
sys_darwin.go
(22.56 KB)
π
sys_darwin_amd64.s
(19.65 KB)
π
sys_darwin_arm64.go
(1.74 KB)
π
sys_darwin_arm64.s
(18.28 KB)
π
sys_dragonfly_amd64.s
(8.31 KB)
π
sys_freebsd_386.s
(9.41 KB)
π
sys_freebsd_amd64.s
(12.67 KB)
π
sys_freebsd_arm.s
(10.38 KB)
π
sys_freebsd_arm64.s
(9.49 KB)
π
sys_freebsd_riscv64.s
(8.92 KB)
π
sys_libc.go
(1.84 KB)
π
sys_linux_386.s
(17.89 KB)
π
sys_linux_amd64.s
(15.74 KB)
π
sys_linux_arm.s
(13.5 KB)
π
sys_linux_arm64.s
(16.71 KB)
π
sys_linux_loong64.s
(14.16 KB)
π
sys_linux_mips64x.s
(11.96 KB)
π
sys_linux_mipsx.s
(9.69 KB)
π
sys_linux_ppc64x.s
(18.09 KB)
π
sys_linux_riscv64.s
(11.48 KB)
π
sys_linux_s390x.s
(12.49 KB)
π
sys_loong64.go
(489 B)
π
sys_mips64x.go
(500 B)
π
sys_mipsx.go
(496 B)
π
sys_netbsd_386.s
(9.61 KB)
π
sys_netbsd_amd64.s
(9.78 KB)
π
sys_netbsd_arm.s
(10.58 KB)
π
sys_netbsd_arm64.s
(9.47 KB)
π
sys_nonppc64x.go
(245 B)
π
sys_openbsd.go
(2.59 KB)
π
sys_openbsd1.go
(1.23 KB)
π
sys_openbsd2.go
(8.67 KB)
π
sys_openbsd3.go
(3.37 KB)
π
sys_openbsd_386.s
(20.4 KB)
π
sys_openbsd_amd64.s
(15.54 KB)
π
sys_openbsd_arm.s
(18.46 KB)
π
sys_openbsd_arm64.s
(15.05 KB)
π
sys_openbsd_mips64.s
(8.81 KB)
π
sys_openbsd_ppc64.s
(15.3 KB)
π
sys_openbsd_riscv64.s
(16.8 KB)
π
sys_plan9_386.s
(4.48 KB)
π
sys_plan9_amd64.s
(4.56 KB)
π
sys_plan9_arm.s
(7.03 KB)
π
sys_ppc64x.go
(532 B)
π
sys_riscv64.go
(469 B)
π
sys_s390x.go
(469 B)
π
sys_solaris_amd64.s
(6.42 KB)
π
sys_wasm.go
(758 B)
π
sys_wasm.s
(1.43 KB)
π
sys_windows_386.s
(6.46 KB)
π
sys_windows_amd64.s
(8.41 KB)
π
sys_windows_arm.s
(7.72 KB)
π
sys_windows_arm64.s
(6.8 KB)
π
sys_x86.go
(552 B)
π
syscall2_solaris.go
(1.85 KB)
π
syscall_aix.go
(6.33 KB)
π
syscall_solaris.go
(8.38 KB)
π
syscall_unix_test.go
(635 B)
π
syscall_windows.go
(16.57 KB)
π
syscall_windows_test.go
(32.45 KB)
π
tagptr.go
(496 B)
π
tagptr_32bit.go
(927 B)
π
tagptr_64bit.go
(3.23 KB)
π
test_amd64.go
(196 B)
π
test_amd64.s
(316 B)
π
test_stubs.go
(218 B)
π
testdata
π
textflag.h
(1.47 KB)
π
time.go
(30.57 KB)
π
time_fake.go
(2.5 KB)
π
time_linux_amd64.s
(2.02 KB)
π
time_nofake.go
(709 B)
π
time_test.go
(2.04 KB)
π
time_windows.h
(753 B)
π
time_windows_386.s
(1.71 KB)
π
time_windows_amd64.s
(786 B)
π
time_windows_arm.s
(1.97 KB)
π
time_windows_arm64.s
(906 B)
π
timeasm.go
(418 B)
π
timestub.go
(532 B)
π
timestub2.go
(363 B)
π
tls_arm.s
(3.45 KB)
π
tls_arm64.h
(1.1 KB)
π
tls_arm64.s
(1.2 KB)
π
tls_loong64.s
(589 B)
π
tls_mips64x.s
(733 B)
π
tls_mipsx.s
(710 B)
π
tls_ppc64x.s
(1.52 KB)
π
tls_riscv64.s
(615 B)
π
tls_s390x.s
(1.55 KB)
π
tls_stub.go
(260 B)
π
tls_windows_amd64.go
(294 B)
π
trace
π
trace.go
(62.76 KB)
π
trace2.go
(33.81 KB)
π
trace2buf.go
(6.58 KB)
π
trace2cpu.go
(8.87 KB)
π
trace2event.go
(8.39 KB)
π
trace2map.go
(4.36 KB)
π
trace2region.go
(1.68 KB)
π
trace2runtime.go
(24.2 KB)
π
trace2stack.go
(9.45 KB)
π
trace2status.go
(7.24 KB)
π
trace2string.go
(2.59 KB)
π
trace2time.go
(3.21 KB)
π
trace_cgo_test.go
(4.47 KB)
π
traceback.go
(54.61 KB)
π
traceback_test.go
(22.95 KB)
π
tracebackx_test.go
(509 B)
π
type.go
(12.1 KB)
π
typekind.go
(743 B)
π
unsafe.go
(2.97 KB)
π
unsafepoint_test.go
(3.27 KB)
π
utf8.go
(3.39 KB)
π
vdso_elf32.go
(2.76 KB)
π
vdso_elf64.go
(2.84 KB)
π
vdso_freebsd.go
(2.44 KB)
π
vdso_freebsd_arm.go
(454 B)
π
vdso_freebsd_arm64.go
(454 B)
π
vdso_freebsd_riscv64.go
(429 B)
π
vdso_freebsd_x86.go
(1.86 KB)
π
vdso_in_none.go
(443 B)
π
vdso_linux.go
(7.77 KB)
π
vdso_linux_386.go
(669 B)
π
vdso_linux_amd64.go
(685 B)
π
vdso_linux_arm.go
(669 B)
π
vdso_linux_arm64.go
(670 B)
π
vdso_linux_loong64.go
(793 B)
π
vdso_linux_mips64x.go
(850 B)
π
vdso_linux_ppc64x.go
(672 B)
π
vdso_linux_riscv64.go
(666 B)
π
vdso_linux_s390x.go
(659 B)
π
vdso_test.go
(3.71 KB)
π
vlop_386.s
(2.02 KB)
π
vlop_arm.s
(7.06 KB)
π
vlop_arm_test.go
(3.75 KB)
π
vlrt.go
(6.71 KB)
π
wincallback.go
(3.45 KB)
π
write_err.go
(291 B)
π
write_err_android.go
(4.65 KB)
π
zcallback_windows.go
(155 B)
π
zcallback_windows.s
(63.06 KB)
π
zcallback_windows_arm.s
(89.32 KB)
π
zcallback_windows_arm64.s
(89.32 KB)
Editing: select.go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package runtime // This file contains the implementation of Go select statements. import ( "internal/abi" "unsafe" ) const debugSelect = false // Select case descriptor. // Known to compiler. // Changes here must also be made in src/cmd/compile/internal/walk/select.go's scasetype. type scase struct { c *hchan // chan elem unsafe.Pointer // data element } var ( chansendpc = abi.FuncPCABIInternal(chansend) chanrecvpc = abi.FuncPCABIInternal(chanrecv) ) func selectsetpc(pc *uintptr) { *pc = getcallerpc() } func sellock(scases []scase, lockorder []uint16) { var c *hchan for _, o := range lockorder { c0 := scases[o].c if c0 != c { c = c0 lock(&c.lock) } } } func selunlock(scases []scase, lockorder []uint16) { // We must be very careful here to not touch sel after we have unlocked // the last lock, because sel can be freed right after the last unlock. // Consider the following situation. // First M calls runtimeΒ·park() in runtimeΒ·selectgo() passing the sel. // Once runtimeΒ·park() has unlocked the last lock, another M makes // the G that calls select runnable again and schedules it for execution. // When the G runs on another M, it locks all the locks and frees sel. // Now if the first M touches sel, it will access freed memory. for i := len(lockorder) - 1; i >= 0; i-- { c := scases[lockorder[i]].c if i > 0 && c == scases[lockorder[i-1]].c { continue // will unlock it on the next iteration } unlock(&c.lock) } } func selparkcommit(gp *g, _ unsafe.Pointer) bool { // There are unlocked sudogs that point into gp's stack. Stack // copying must lock the channels of those sudogs. // Set activeStackChans here instead of before we try parking // because we could self-deadlock in stack growth on a // channel lock. gp.activeStackChans = true // Mark that it's safe for stack shrinking to occur now, // because any thread acquiring this G's stack for shrinking // is guaranteed to observe activeStackChans after this store. gp.parkingOnChan.Store(false) // Make sure we unlock after setting activeStackChans and // unsetting parkingOnChan. The moment we unlock any of the // channel locks we risk gp getting readied by a channel operation // and so gp could continue running before everything before the // unlock is visible (even to gp itself). // This must not access gp's stack (see gopark). In // particular, it must not access the *hselect. That's okay, // because by the time this is called, gp.waiting has all // channels in lock order. var lastc *hchan for sg := gp.waiting; sg != nil; sg = sg.waitlink { if sg.c != lastc && lastc != nil { // As soon as we unlock the channel, fields in // any sudog with that channel may change, // including c and waitlink. Since multiple // sudogs may have the same channel, we unlock // only after we've passed the last instance // of a channel. unlock(&lastc.lock) } lastc = sg.c } if lastc != nil { unlock(&lastc.lock) } return true } func block() { gopark(nil, nil, waitReasonSelectNoCases, traceBlockForever, 1) // forever } // selectgo implements the select statement. // // cas0 points to an array of type [ncases]scase, and order0 points to // an array of type [2*ncases]uint16 where ncases must be <= 65536. // Both reside on the goroutine's stack (regardless of any escaping in // selectgo). // // For race detector builds, pc0 points to an array of type // [ncases]uintptr (also on the stack); for other builds, it's set to // nil. // // selectgo returns the index of the chosen scase, which matches the // ordinal position of its respective select{recv,send,default} call. // Also, if the chosen scase was a receive operation, it reports whether // a value was received. func selectgo(cas0 *scase, order0 *uint16, pc0 *uintptr, nsends, nrecvs int, block bool) (int, bool) { if debugSelect { print("select: cas0=", cas0, "\n") } // NOTE: In order to maintain a lean stack size, the number of scases // is capped at 65536. cas1 := (*[1 << 16]scase)(unsafe.Pointer(cas0)) order1 := (*[1 << 17]uint16)(unsafe.Pointer(order0)) ncases := nsends + nrecvs scases := cas1[:ncases:ncases] pollorder := order1[:ncases:ncases] lockorder := order1[ncases:][:ncases:ncases] // NOTE: pollorder/lockorder's underlying array was not zero-initialized by compiler. // Even when raceenabled is true, there might be select // statements in packages compiled without -race (e.g., // ensureSigM in runtime/signal_unix.go). var pcs []uintptr if raceenabled && pc0 != nil { pc1 := (*[1 << 16]uintptr)(unsafe.Pointer(pc0)) pcs = pc1[:ncases:ncases] } casePC := func(casi int) uintptr { if pcs == nil { return 0 } return pcs[casi] } var t0 int64 if blockprofilerate > 0 { t0 = cputicks() } // The compiler rewrites selects that statically have // only 0 or 1 cases plus default into simpler constructs. // The only way we can end up with such small sel.ncase // values here is for a larger select in which most channels // have been nilled out. The general code handles those // cases correctly, and they are rare enough not to bother // optimizing (and needing to test). // generate permuted order norder := 0 for i := range scases { cas := &scases[i] // Omit cases without channels from the poll and lock orders. if cas.c == nil { cas.elem = nil // allow GC continue } j := cheaprandn(uint32(norder + 1)) pollorder[norder] = pollorder[j] pollorder[j] = uint16(i) norder++ } pollorder = pollorder[:norder] lockorder = lockorder[:norder] // sort the cases by Hchan address to get the locking order. // simple heap sort, to guarantee n log n time and constant stack footprint. for i := range lockorder { j := i // Start with the pollorder to permute cases on the same channel. c := scases[pollorder[i]].c for j > 0 && scases[lockorder[(j-1)/2]].c.sortkey() < c.sortkey() { k := (j - 1) / 2 lockorder[j] = lockorder[k] j = k } lockorder[j] = pollorder[i] } for i := len(lockorder) - 1; i >= 0; i-- { o := lockorder[i] c := scases[o].c lockorder[i] = lockorder[0] j := 0 for { k := j*2 + 1 if k >= i { break } if k+1 < i && scases[lockorder[k]].c.sortkey() < scases[lockorder[k+1]].c.sortkey() { k++ } if c.sortkey() < scases[lockorder[k]].c.sortkey() { lockorder[j] = lockorder[k] j = k continue } break } lockorder[j] = o } if debugSelect { for i := 0; i+1 < len(lockorder); i++ { if scases[lockorder[i]].c.sortkey() > scases[lockorder[i+1]].c.sortkey() { print("i=", i, " x=", lockorder[i], " y=", lockorder[i+1], "\n") throw("select: broken sort") } } } // lock all the channels involved in the select sellock(scases, lockorder) var ( gp *g sg *sudog c *hchan k *scase sglist *sudog sgnext *sudog qp unsafe.Pointer nextp **sudog ) // pass 1 - look for something already waiting var casi int var cas *scase var caseSuccess bool var caseReleaseTime int64 = -1 var recvOK bool for _, casei := range pollorder { casi = int(casei) cas = &scases[casi] c = cas.c if casi >= nsends { sg = c.sendq.dequeue() if sg != nil { goto recv } if c.qcount > 0 { goto bufrecv } if c.closed != 0 { goto rclose } } else { if raceenabled { racereadpc(c.raceaddr(), casePC(casi), chansendpc) } if c.closed != 0 { goto sclose } sg = c.recvq.dequeue() if sg != nil { goto send } if c.qcount < c.dataqsiz { goto bufsend } } } if !block { selunlock(scases, lockorder) casi = -1 goto retc } // pass 2 - enqueue on all chans gp = getg() if gp.waiting != nil { throw("gp.waiting != nil") } nextp = &gp.waiting for _, casei := range lockorder { casi = int(casei) cas = &scases[casi] c = cas.c sg := acquireSudog() sg.g = gp sg.isSelect = true // No stack splits between assigning elem and enqueuing // sg on gp.waiting where copystack can find it. sg.elem = cas.elem sg.releasetime = 0 if t0 != 0 { sg.releasetime = -1 } sg.c = c // Construct waiting list in lock order. *nextp = sg nextp = &sg.waitlink if casi < nsends { c.sendq.enqueue(sg) } else { c.recvq.enqueue(sg) } } // wait for someone to wake us up gp.param = nil // Signal to anyone trying to shrink our stack that we're about // to park on a channel. The window between when this G's status // changes and when we set gp.activeStackChans is not safe for // stack shrinking. gp.parkingOnChan.Store(true) gopark(selparkcommit, nil, waitReasonSelect, traceBlockSelect, 1) gp.activeStackChans = false sellock(scases, lockorder) gp.selectDone.Store(0) sg = (*sudog)(gp.param) gp.param = nil // pass 3 - dequeue from unsuccessful chans // otherwise they stack up on quiet channels // record the successful case, if any. // We singly-linked up the SudoGs in lock order. casi = -1 cas = nil caseSuccess = false sglist = gp.waiting // Clear all elem before unlinking from gp.waiting. for sg1 := gp.waiting; sg1 != nil; sg1 = sg1.waitlink { sg1.isSelect = false sg1.elem = nil sg1.c = nil } gp.waiting = nil for _, casei := range lockorder { k = &scases[casei] if sg == sglist { // sg has already been dequeued by the G that woke us up. casi = int(casei) cas = k caseSuccess = sglist.success if sglist.releasetime > 0 { caseReleaseTime = sglist.releasetime } } else { c = k.c if int(casei) < nsends { c.sendq.dequeueSudoG(sglist) } else { c.recvq.dequeueSudoG(sglist) } } sgnext = sglist.waitlink sglist.waitlink = nil releaseSudog(sglist) sglist = sgnext } if cas == nil { throw("selectgo: bad wakeup") } c = cas.c if debugSelect { print("wait-return: cas0=", cas0, " c=", c, " cas=", cas, " send=", casi < nsends, "\n") } if casi < nsends { if !caseSuccess { goto sclose } } else { recvOK = caseSuccess } if raceenabled { if casi < nsends { raceReadObjectPC(c.elemtype, cas.elem, casePC(casi), chansendpc) } else if cas.elem != nil { raceWriteObjectPC(c.elemtype, cas.elem, casePC(casi), chanrecvpc) } } if msanenabled { if casi < nsends { msanread(cas.elem, c.elemtype.Size_) } else if cas.elem != nil { msanwrite(cas.elem, c.elemtype.Size_) } } if asanenabled { if casi < nsends { asanread(cas.elem, c.elemtype.Size_) } else if cas.elem != nil { asanwrite(cas.elem, c.elemtype.Size_) } } selunlock(scases, lockorder) goto retc bufrecv: // can receive from buffer if raceenabled { if cas.elem != nil { raceWriteObjectPC(c.elemtype, cas.elem, casePC(casi), chanrecvpc) } racenotify(c, c.recvx, nil) } if msanenabled && cas.elem != nil { msanwrite(cas.elem, c.elemtype.Size_) } if asanenabled && cas.elem != nil { asanwrite(cas.elem, c.elemtype.Size_) } recvOK = true qp = chanbuf(c, c.recvx) if cas.elem != nil { typedmemmove(c.elemtype, cas.elem, qp) } typedmemclr(c.elemtype, qp) c.recvx++ if c.recvx == c.dataqsiz { c.recvx = 0 } c.qcount-- selunlock(scases, lockorder) goto retc bufsend: // can send to buffer if raceenabled { racenotify(c, c.sendx, nil) raceReadObjectPC(c.elemtype, cas.elem, casePC(casi), chansendpc) } if msanenabled { msanread(cas.elem, c.elemtype.Size_) } if asanenabled { asanread(cas.elem, c.elemtype.Size_) } typedmemmove(c.elemtype, chanbuf(c, c.sendx), cas.elem) c.sendx++ if c.sendx == c.dataqsiz { c.sendx = 0 } c.qcount++ selunlock(scases, lockorder) goto retc recv: // can receive from sleeping sender (sg) recv(c, sg, cas.elem, func() { selunlock(scases, lockorder) }, 2) if debugSelect { print("syncrecv: cas0=", cas0, " c=", c, "\n") } recvOK = true goto retc rclose: // read at end of closed channel selunlock(scases, lockorder) recvOK = false if cas.elem != nil { typedmemclr(c.elemtype, cas.elem) } if raceenabled { raceacquire(c.raceaddr()) } goto retc send: // can send to a sleeping receiver (sg) if raceenabled { raceReadObjectPC(c.elemtype, cas.elem, casePC(casi), chansendpc) } if msanenabled { msanread(cas.elem, c.elemtype.Size_) } if asanenabled { asanread(cas.elem, c.elemtype.Size_) } send(c, sg, cas.elem, func() { selunlock(scases, lockorder) }, 2) if debugSelect { print("syncsend: cas0=", cas0, " c=", c, "\n") } goto retc retc: if caseReleaseTime > 0 { blockevent(caseReleaseTime-t0, 1) } return casi, recvOK sclose: // send on closed channel selunlock(scases, lockorder) panic(plainError("send on closed channel")) } func (c *hchan) sortkey() uintptr { return uintptr(unsafe.Pointer(c)) } // A runtimeSelect is a single case passed to rselect. // This must match ../reflect/value.go:/runtimeSelect type runtimeSelect struct { dir selectDir typ unsafe.Pointer // channel type (not used here) ch *hchan // channel val unsafe.Pointer // ptr to data (SendDir) or ptr to receive buffer (RecvDir) } // These values must match ../reflect/value.go:/SelectDir. type selectDir int const ( _ selectDir = iota selectSend // case Chan <- Send selectRecv // case <-Chan: selectDefault // default ) //go:linkname reflect_rselect reflect.rselect func reflect_rselect(cases []runtimeSelect) (int, bool) { if len(cases) == 0 { block() } sel := make([]scase, len(cases)) orig := make([]int, len(cases)) nsends, nrecvs := 0, 0 dflt := -1 for i, rc := range cases { var j int switch rc.dir { case selectDefault: dflt = i continue case selectSend: j = nsends nsends++ case selectRecv: nrecvs++ j = len(cases) - nrecvs } sel[j] = scase{c: rc.ch, elem: rc.val} orig[j] = i } // Only a default case. if nsends+nrecvs == 0 { return dflt, false } // Compact sel and orig if necessary. if nsends+nrecvs < len(cases) { copy(sel[nsends:], sel[len(cases)-nrecvs:]) copy(orig[nsends:], orig[len(cases)-nrecvs:]) } order := make([]uint16, 2*(nsends+nrecvs)) var pc0 *uintptr if raceenabled { pcs := make([]uintptr, nsends+nrecvs) for i := range pcs { selectsetpc(&pcs[i]) } pc0 = &pcs[0] } chosen, recvOK := selectgo(&sel[0], &order[0], pc0, nsends, nrecvs, dflt == -1) // Translate chosen back to caller's ordering. if chosen < 0 { chosen = dflt } else { chosen = orig[chosen] } return chosen, recvOK } func (q *waitq) dequeueSudoG(sgp *sudog) { x := sgp.prev y := sgp.next if x != nil { if y != nil { // middle of queue x.next = y y.prev = x sgp.next = nil sgp.prev = nil return } // end of queue x.next = nil q.last = x sgp.prev = nil return } if y != nil { // start of queue y.prev = nil q.first = y sgp.next = nil return } // x==y==nil. Either sgp is the only element in the queue, // or it has already been removed. Use q.first to disambiguate. if q.first == sgp { q.first = nil q.last = nil } }
Upload File
Create Folder