mirror of
https://github.com/hexagonal-sun/moss-kernel.git
synced 2026-01-30 17:11:47 -05:00
thread_group: pgid: inherit from parent
Inherit the process-group ID from the parent. If there is no parent specified then the pgid is the same as the tgid.
This commit is contained in:
@@ -62,7 +62,12 @@ impl ThreadGroupBuilder {
|
||||
pub fn build(self) -> Arc<ThreadGroup> {
|
||||
let ret = Arc::new(ThreadGroup {
|
||||
tgid: self.tgid,
|
||||
pgid: SpinLock::new(Pgid(self.tgid.value())),
|
||||
pgid: SpinLock::new(
|
||||
self.parent
|
||||
.as_ref()
|
||||
.map(|x| *x.pgid.lock_save_irq())
|
||||
.unwrap_or_else(|| Pgid(self.tgid.value())),
|
||||
),
|
||||
sid: SpinLock::new(Sid(self.tgid.value())),
|
||||
parent: SpinLock::new(self.parent.as_ref().map(Arc::downgrade)),
|
||||
umask: SpinLock::new(self.umask.unwrap_or(0)),
|
||||
|
||||
Reference in New Issue
Block a user