Open Bug 1628198 Opened 5 years ago Updated 2 years ago

Use thread-local instead of global in UnderrunHandlerLinux

Categories

(Core :: Audio/Video: cubeb, defect, P2)

defect

Tracking

()

People

(Reporter: karlt, Unassigned)

References

Details

A different thread can reset gRealtimeLimitReached, in which case the thread signalled may not be demoted.

An alternative would be to send a thread id over a pipe to a realtime watchdog thread that would demote the process, avoiding the risk of waiting for the infringing thread to yield.

See Also: → 1625372

There may be some limit to the meaning of the thread receiving SIGXCPU.

RLIMIT_RTTIME applies to a single thread, but SIGXCPU is sent to the thread group (a process-directed signal).

man 7 signal says

A process-directed signal may be delivered to any one of the threads
that does not currently have the signal blocked. If more than one of
the threads has the signal unblocked, then the kernel chooses an
arbitrary thread to which to deliver the signal.

In Linux, the realtime thread is usually tried first for signal delivery, but, if that thread is blocking the signal or in some other cases, the signal will be delivered to another thread.

I don't see any thread-identifying info in the siginfo.

Blocks: 1653667
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.