Linux vmi284606.contaboserver.net 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64
Apache/2.4.57 (Ubuntu)
: 167.86.127.34 | : 216.73.217.31
Cant Read [ /etc/named.conf ]
7.2.24-0ubuntu0.18.04.17
root
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
usr /
local /
go /
src /
internal /
poll /
[ HOME SHELL ]
Name
Size
Permission
Action
errno_unix.go
738
B
-rw-r--r--
errno_windows.go
724
B
-rw-r--r--
error_linux_test.go
748
B
-rw-r--r--
error_stub_test.go
412
B
-rw-r--r--
error_test.go
1.04
KB
-rw-r--r--
export_posix_test.go
481
B
-rw-r--r--
export_test.go
708
B
-rw-r--r--
export_windows_test.go
431
B
-rw-r--r--
fcntl_js.go
325
B
-rw-r--r--
fcntl_libc.go
365
B
-rw-r--r--
fcntl_syscall.go
484
B
-rw-r--r--
fd.go
2.1
KB
-rw-r--r--
fd_fsync_darwin.go
535
B
-rw-r--r--
fd_fsync_posix.go
428
B
-rw-r--r--
fd_fsync_windows.go
358
B
-rw-r--r--
fd_io_plan9.go
2.1
KB
-rw-r--r--
fd_mutex.go
6.42
KB
-rw-r--r--
fd_mutex_test.go
3.88
KB
-rw-r--r--
fd_opendir_darwin.go
847
B
-rw-r--r--
fd_plan9.go
4.97
KB
-rw-r--r--
fd_poll_js.go
2.27
KB
-rw-r--r--
fd_poll_runtime.go
3.74
KB
-rw-r--r--
fd_posix.go
1.05
KB
-rw-r--r--
fd_posix_test.go
1.27
KB
-rw-r--r--
fd_unix.go
13.51
KB
-rw-r--r--
fd_windows.go
28.75
KB
-rw-r--r--
fd_windows_test.go
2.25
KB
-rw-r--r--
fd_writev_darwin.go
388
B
-rw-r--r--
fd_writev_unix.go
502
B
-rw-r--r--
hook_cloexec.go
371
B
-rw-r--r--
hook_unix.go
481
B
-rw-r--r--
hook_windows.go
668
B
-rw-r--r--
read_test.go
1.07
KB
-rw-r--r--
sendfile_bsd.go
1.17
KB
-rw-r--r--
sendfile_linux.go
1.1
KB
-rw-r--r--
sendfile_solaris.go
1.46
KB
-rw-r--r--
sendfile_windows.go
2.01
KB
-rw-r--r--
sock_cloexec.go
1.76
KB
-rw-r--r--
sockopt.go
1.08
KB
-rw-r--r--
sockopt_linux.go
490
B
-rw-r--r--
sockopt_unix.go
532
B
-rw-r--r--
sockopt_windows.go
862
B
-rw-r--r--
sockoptip.go
866
B
-rw-r--r--
splice_linux.go
5.66
KB
-rw-r--r--
strconv.go
946
B
-rw-r--r--
sys_cloexec.go
1.1
KB
-rw-r--r--
writev.go
1.76
KB
-rw-r--r--
writev_test.go
1.31
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : fd_mutex.go
// Copyright 2013 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 poll import "sync/atomic" // fdMutex is a specialized synchronization primitive that manages // lifetime of an fd and serializes access to Read, Write and Close // methods on FD. type fdMutex struct { state uint64 rsema uint32 wsema uint32 } // fdMutex.state is organized as follows: // 1 bit - whether FD is closed, if set all subsequent lock operations will fail. // 1 bit - lock for read operations. // 1 bit - lock for write operations. // 20 bits - total number of references (read+write+misc). // 20 bits - number of outstanding read waiters. // 20 bits - number of outstanding write waiters. const ( mutexClosed = 1 << 0 mutexRLock = 1 << 1 mutexWLock = 1 << 2 mutexRef = 1 << 3 mutexRefMask = (1<<20 - 1) << 3 mutexRWait = 1 << 23 mutexRMask = (1<<20 - 1) << 23 mutexWWait = 1 << 43 mutexWMask = (1<<20 - 1) << 43 ) const overflowMsg = "too many concurrent operations on a single file or socket (max 1048575)" // Read operations must do rwlock(true)/rwunlock(true). // // Write operations must do rwlock(false)/rwunlock(false). // // Misc operations must do incref/decref. // Misc operations include functions like setsockopt and setDeadline. // They need to use incref/decref to ensure that they operate on the // correct fd in presence of a concurrent close call (otherwise fd can // be closed under their feet). // // Close operations must do increfAndClose/decref. // incref adds a reference to mu. // It reports whether mu is available for reading or writing. func (mu *fdMutex) incref() bool { for { old := atomic.LoadUint64(&mu.state) if old&mutexClosed != 0 { return false } new := old + mutexRef if new&mutexRefMask == 0 { panic(overflowMsg) } if atomic.CompareAndSwapUint64(&mu.state, old, new) { return true } } } // increfAndClose sets the state of mu to closed. // It returns false if the file was already closed. func (mu *fdMutex) increfAndClose() bool { for { old := atomic.LoadUint64(&mu.state) if old&mutexClosed != 0 { return false } // Mark as closed and acquire a reference. new := (old | mutexClosed) + mutexRef if new&mutexRefMask == 0 { panic(overflowMsg) } // Remove all read and write waiters. new &^= mutexRMask | mutexWMask if atomic.CompareAndSwapUint64(&mu.state, old, new) { // Wake all read and write waiters, // they will observe closed flag after wakeup. for old&mutexRMask != 0 { old -= mutexRWait runtime_Semrelease(&mu.rsema) } for old&mutexWMask != 0 { old -= mutexWWait runtime_Semrelease(&mu.wsema) } return true } } } // decref removes a reference from mu. // It reports whether there is no remaining reference. func (mu *fdMutex) decref() bool { for { old := atomic.LoadUint64(&mu.state) if old&mutexRefMask == 0 { panic("inconsistent poll.fdMutex") } new := old - mutexRef if atomic.CompareAndSwapUint64(&mu.state, old, new) { return new&(mutexClosed|mutexRefMask) == mutexClosed } } } // lock adds a reference to mu and locks mu. // It reports whether mu is available for reading or writing. func (mu *fdMutex) rwlock(read bool) bool { var mutexBit, mutexWait, mutexMask uint64 var mutexSema *uint32 if read { mutexBit = mutexRLock mutexWait = mutexRWait mutexMask = mutexRMask mutexSema = &mu.rsema } else { mutexBit = mutexWLock mutexWait = mutexWWait mutexMask = mutexWMask mutexSema = &mu.wsema } for { old := atomic.LoadUint64(&mu.state) if old&mutexClosed != 0 { return false } var new uint64 if old&mutexBit == 0 { // Lock is free, acquire it. new = (old | mutexBit) + mutexRef if new&mutexRefMask == 0 { panic(overflowMsg) } } else { // Wait for lock. new = old + mutexWait if new&mutexMask == 0 { panic(overflowMsg) } } if atomic.CompareAndSwapUint64(&mu.state, old, new) { if old&mutexBit == 0 { return true } runtime_Semacquire(mutexSema) // The signaller has subtracted mutexWait. } } } // unlock removes a reference from mu and unlocks mu. // It reports whether there is no remaining reference. func (mu *fdMutex) rwunlock(read bool) bool { var mutexBit, mutexWait, mutexMask uint64 var mutexSema *uint32 if read { mutexBit = mutexRLock mutexWait = mutexRWait mutexMask = mutexRMask mutexSema = &mu.rsema } else { mutexBit = mutexWLock mutexWait = mutexWWait mutexMask = mutexWMask mutexSema = &mu.wsema } for { old := atomic.LoadUint64(&mu.state) if old&mutexBit == 0 || old&mutexRefMask == 0 { panic("inconsistent poll.fdMutex") } // Drop lock, drop reference and wake read waiter if present. new := (old &^ mutexBit) - mutexRef if old&mutexMask != 0 { new -= mutexWait } if atomic.CompareAndSwapUint64(&mu.state, old, new) { if old&mutexMask != 0 { runtime_Semrelease(mutexSema) } return new&(mutexClosed|mutexRefMask) == mutexClosed } } } // Implemented in runtime package. func runtime_Semacquire(sema *uint32) func runtime_Semrelease(sema *uint32) // incref adds a reference to fd. // It returns an error when fd cannot be used. func (fd *FD) incref() error { if !fd.fdmu.incref() { return errClosing(fd.isFile) } return nil } // decref removes a reference from fd. // It also closes fd when the state of fd is set to closed and there // is no remaining reference. func (fd *FD) decref() error { if fd.fdmu.decref() { return fd.destroy() } return nil } // readLock adds a reference to fd and locks fd for reading. // It returns an error when fd cannot be used for reading. func (fd *FD) readLock() error { if !fd.fdmu.rwlock(true) { return errClosing(fd.isFile) } return nil } // readUnlock removes a reference from fd and unlocks fd for reading. // It also closes fd when the state of fd is set to closed and there // is no remaining reference. func (fd *FD) readUnlock() { if fd.fdmu.rwunlock(true) { fd.destroy() } } // writeLock adds a reference to fd and locks fd for writing. // It returns an error when fd cannot be used for writing. func (fd *FD) writeLock() error { if !fd.fdmu.rwlock(false) { return errClosing(fd.isFile) } return nil } // writeUnlock removes a reference from fd and unlocks fd for writing. // It also closes fd when the state of fd is set to closed and there // is no remaining reference. func (fd *FD) writeUnlock() { if fd.fdmu.rwunlock(false) { fd.destroy() } }
Close