- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 17 for ForkLock (0.14 sec)
-
src/syscall/forkpipe2.go
// the standard library should never take a read // lock on ForkLock. forkingLock.Unlock() ForkLock.RLock() ForkLock.RUnlock() forkingLock.Lock() // Readers got a chance, so now take the write lock. if forking == 0 { ForkLock.Lock() } } forking++ } // releaseForkLock releases the conceptual write lock on ForkLock // acquired by acquireForkLock. func releaseForkLock() {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Jul 10 19:19:59 UTC 2023 - 2.6K bytes - Viewed (0) -
src/net/sys_cloexec.go
// descriptor as nonblocking and close-on-exec. func sysSocket(family, sotype, proto int) (int, error) { // See ../syscall/exec_unix.go for description of ForkLock. syscall.ForkLock.RLock() s, err := socketFunc(family, sotype, proto) if err == nil { syscall.CloseOnExec(s) } syscall.ForkLock.RUnlock() if err != nil { return -1, os.NewSyscallError("socket", err) } if err = syscall.SetNonblock(s, true); err != nil {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue May 03 14:38:32 UTC 2022 - 962 bytes - Viewed (0) -
src/net/sock_cloexec_solaris.go
if err != nil { return -1, os.NewSyscallError("socket", err) } return s, nil } // See ../syscall/exec_unix.go for description of ForkLock. syscall.ForkLock.RLock() s, err := socketFunc(family, sotype, proto) if err == nil { syscall.CloseOnExec(s) } syscall.ForkLock.RUnlock() if err != nil { return -1, os.NewSyscallError("socket", err) } if err = syscall.SetNonblock(s, true); err != nil {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Sun Apr 14 18:17:25 UTC 2024 - 1.4K bytes - Viewed (0) -
src/os/pipe_unix.go
var p [2]int // See ../syscall/exec.go for description of lock. syscall.ForkLock.RLock() e := syscall.Pipe(p[0:]) if e != nil { syscall.ForkLock.RUnlock() return nil, nil, NewSyscallError("pipe", e) } syscall.CloseOnExec(p[0]) syscall.CloseOnExec(p[1]) syscall.ForkLock.RUnlock() return newFile(p[0], "|0", kindPipe, false), newFile(p[1], "|1", kindPipe, false), nil
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Mar 19 11:47:23 UTC 2024 - 774 bytes - Viewed (0) -
src/internal/poll/sock_cloexec_solaris.go
} return ns, sa, "", nil } // See ../syscall/exec_unix.go for description of ForkLock. // It is probably okay to hold the lock across syscall.Accept // because we have put fd.sysfd into non-blocking mode. // However, a call to the File method will put it back into // blocking mode. We can't take that risk, so no use of ForkLock here. ns, sa, err := AcceptFunc(s) if err == nil { syscall.CloseOnExec(ns) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Sun Apr 14 18:17:25 UTC 2024 - 1.5K bytes - Viewed (0) -
src/syscall/forkpipe.go
} _, err = fcntl(p[0], F_SETFD, FD_CLOEXEC) if err != nil { return err } _, err = fcntl(p[1], F_SETFD, FD_CLOEXEC) return err } func acquireForkLock() { ForkLock.Lock() } func releaseForkLock() { ForkLock.Unlock()
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Jul 10 19:19:59 UTC 2023 - 604 bytes - Viewed (0) -
src/syscall/exec_unix.go
// non-blocking I/O to accept on a listening socket. // The rules for which file descriptor-creating operations use the // ForkLock are as follows: // // - [Pipe]. Use pipe2 if available. Otherwise, does not block, // so use ForkLock. // - [Socket]. Use SOCK_CLOEXEC if available. Otherwise, does not // block, so use ForkLock. // - [Open]. Use [O_CLOEXEC] if available. Otherwise, may block, // so live with the race.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Feb 26 21:03:59 UTC 2024 - 8.7K bytes - Viewed (0) -
src/internal/poll/sys_cloexec.go
func accept(s int) (int, syscall.Sockaddr, string, error) { // See ../syscall/exec_unix.go for description of ForkLock. // It is probably okay to hold the lock across syscall.Accept // because we have put fd.sysfd into non-blocking mode. // However, a call to the File method will put it back into // blocking mode. We can't take that risk, so no use of ForkLock here. ns, sa, err := AcceptFunc(s) if err == nil { syscall.CloseOnExec(ns) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Apr 07 23:34:17 UTC 2023 - 1.1K bytes - Viewed (0) -
src/internal/poll/sock_cloexec_accept.go
} // See ../syscall/exec_unix.go for description of ForkLock. // It is probably okay to hold the lock across syscall.Accept // because we have put fd.sysfd into non-blocking mode. // However, a call to the File method will put it back into // blocking mode. We can't take that risk, so no use of ForkLock here. ns, sa, err = AcceptFunc(s) if err == nil { syscall.CloseOnExec(ns) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Dec 16 03:40:42 UTC 2022 - 1.8K bytes - Viewed (0) -
src/internal/poll/fd_unixjs.go
return CloseFunc(fd) } // dupCloseOnExecOld is the traditional way to dup an fd and // set its O_CLOEXEC bit, using two system calls. func dupCloseOnExecOld(fd int) (int, string, error) { syscall.ForkLock.RLock() defer syscall.ForkLock.RUnlock() newfd, err := syscall.Dup(fd) if err != nil { return -1, "dup", err } syscall.CloseOnExec(newfd) return newfd, "", nil } // Fchdir wraps syscall.Fchdir.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 25 00:12:41 UTC 2023 - 2K bytes - Viewed (0)