Skip to content

os/signal: documentation clarification #67773

@withinboredom

Description

@withinboredom

Go version

1.23

Output of go env in your module/workspace:

N/A

What did you do?

The current documentation reads:

The non-Go code should not change the signal mask on any threads created by the Go runtime. If the non-Go code starts new threads of its own, it may set the signal mask as it pleases.

But it doesn't state the consequences for doing so or in what conditions it is safe to do so. For example:

func callC() {
  runtime.LockOSThread()
  C.methodThatEventuallyCallsBackToGo()
}

// later
go callC()

What exactly would happen to signal masks in this case? Further, is the documentation saying that only if non-go code starts threads, it can set the signal mask, or is it saying that only the children may set signal masks?

What did you see happen?

Confusing or missing documentation in regards to signal masks.

What did you expect to see?

More detail and clarification in regards to signal masks in non-go code.

Metadata

Metadata

Labels

DocumentationIssues describing a change to documentation.FrozenDueToAgecompiler/runtimeIssues related to the Go compiler and/or runtime.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions