mozilla::MonitorAutoEnter

mozilla::MonitorAutoEnter is an RAII helper for mozilla::Monitor. It is designed to make using mozilla::Monitor safer and easier. To use mozilla::MonitorAutoEnter, declare and initialize it with a reference to a mozilla::Monitor. The mozilla::MonitorAutoEnter constructor will Enter() the underlying mozilla::Monitor automatically. When the mozilla::MonitorAutoEnter goes out of scope, its destructor will Exit() the underlying mozilla::MonitorAutoEnter.

Important: When a mozilla::MonitorAutoEnter is live on the stack, your code is guaranteed to own the underlying mozilla::Monitor.

Constructors

MonitorAutoEnter(
in mozilla::Monitor& monitor;
);

This parameter is a reference so as to guarantee that your code has already properly constructed the mozilla::Monitor.