Skip to content

Support registering wait handle callbacks in the managed wait subsystem. #131574

Description

@teo-tsirpanis

On non-Windows platforms, WaitHandles do not wrap kernel objects, but they are implemented in managed code. This means that it should be possible to implement RegisterWaitForSingleObject by registering a callback directly on the WaitHandle, and queueing it to the thread pool when the wait handle gets signaled. With this and #131196, we can remove PortableThreadPool.WaitThread.

One complication would be with named cross-process mutexes which use shared memory, but RegisterWaitForSingleObject already has unclear semantics when used with mutexes. We can throw NotSupportedException in this case.

Metadata

Metadata

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions