Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more thread to t renames #125

Merged
merged 1 commit into from
Aug 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions kernel/modules/socket/unix/unix.v
Original file line number Diff line number Diff line change
Expand Up @@ -294,13 +294,13 @@ fn (mut this UnixSocket) connect(handle voidptr, _addr voidptr, addrlen u64) ? {
return none
}

mut thread := proc.current_thread()
mut t := proc.current_thread()

path := unsafe { cstring_to_vstring(&addr.sun_path[0]) }

C.printf(c'UNIX socket: Wants to connect to %s\n', path.str)

mut target := fs.get_node(thread.process.current_directory, path, true) or { return none }
mut target := fs.get_node(t.process.current_directory, path, true) or { return none }

target_res := target.resource

Expand Down Expand Up @@ -351,13 +351,11 @@ fn (mut this UnixSocket) bind(handle voidptr, _addr voidptr, addrlen u64) ? {
return none
}

mut thread := proc.current_thread()
mut t := proc.current_thread()

path := unsafe { cstring_to_vstring(&addr.sun_path[0]) }

mut node := fs.create(thread.process.current_directory, path, stat.ifsock) or {
return none
}
mut node := fs.create(t.process.current_directory, path, stat.ifsock) or { return none }

this.stat = node.resource.stat
node.resource = unsafe { this }
Expand Down
8 changes: 4 additions & 4 deletions kernel/modules/userland/signalfd.v
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ pub fn syscall_signalfd(_ voidptr, fdnum int, mask u64, flags int) (u64, u64) {
mut signalfd := &SignalFD(unsafe { nil })
mut newfd := int(0)

mut thread := proc.current_thread()
mut t := proc.current_thread()

thread.signalfds_lock.acquire()
t.signalfds_lock.acquire()
defer {
thread.signalfds_lock.release()
t.signalfds_lock.release()
}

if fdnum == -1 {
Expand All @@ -105,7 +105,7 @@ pub fn syscall_signalfd(_ voidptr, fdnum int, mask u64, flags int) (u64, u64) {
return errno.err, errno.get()
}

thread.signalfds << voidptr(signalfd)
t.signalfds << voidptr(signalfd)
} else {
mut fd := file.fd_from_fdnum(voidptr(0), fdnum) or { return errno.err, errno.get() }

Expand Down
Loading