The Battle for Wesnoth  1.19.7+dev
Public Member Functions | Private Attributes | List of all members
gui2::event::resource_locker Class Reference

Small helper to keep a resource (boolean) locked. More...

Public Member Functions

 resource_locker (bool &locked)
 
 ~resource_locker ()
 

Private Attributes

bool & locked_
 

Detailed Description

Small helper to keep a resource (boolean) locked.

Some of the event handling routines can't be called recursively, this due to the fact that they are attached to the pre queue and when the forward an event the pre queue event gets triggered recursively causing infinite recursion.

To prevent that those functions check the lock and exit when the lock is held otherwise grab the lock here.

Definition at line 43 of file distributor.cpp.

Constructor & Destructor Documentation

◆ resource_locker()

gui2::event::resource_locker::resource_locker ( bool &  locked)
inline

Definition at line 46 of file distributor.cpp.

References locked_.

◆ ~resource_locker()

gui2::event::resource_locker::~resource_locker ( )
inline

Definition at line 52 of file distributor.cpp.

References locked_.

Member Data Documentation

◆ locked_

bool& gui2::event::resource_locker::locked_
private

Definition at line 59 of file distributor.cpp.

Referenced by resource_locker(), and ~resource_locker().


The documentation for this class was generated from the following file: