A RAII lock for manipulating and updating the application and its widgets outside of the event loop. More...
|UpdateLock (WApplication *app)|
|Creates and locks the given application. More...|
|UpdateLock (const UpdateLock &)|
|Copy constructor (deprecated). More...|
|operator bool () const|
|Tests whether the update lock was succesfully taken. More...|
|Releases the lock. |
A RAII lock for manipulating and updating the application and its widgets outside of the event loop.
You can use this lock to manipulate widgets outside of the event loop. Inside the event loop (including events posted using WServer::post()), this lock is already held by the library itself.
The lock is recursive, so trying to take a lock, while already holding a lock, will not block.
Creates and locks the given application.
The lock guarantees exclusive access to modify the application's state.
You should also consider WServer::post() for lock-free communication between different application sessions.
As soon as the library decides to destroy the application, the lock will no longer succeed in taking the application lock. You can need to detect this by checking that after the lock is taken, the lock is taken:
|Wt::WApplication::UpdateLock::UpdateLock||(||const UpdateLock &||other||)|
Tests whether the update lock was succesfully taken.
This may return
false when the library has already decided to destroy the session (but before your application finalizer/destructor has run to notify helper threads that the application is destroyed).