List locks

x::w::list_lock lock{l};

The library's internal execution thread invokes all list callbacks. These callbacks, if needed, may construct their own independent x::w::list_lock by passing a x::w::listlayoutmanager to its constructor.

Constructing the list lock blocks other execution threads from accessing the contents of the list until the list lock goes out of scope and gets destroyed. The list lock is available to the application's main execution thread, making a consistent snapshot of the list's items, and blocking the library's execution thread from changing the list items' selection status in the interim. Similarly the callbacks invoked by the internal execution threads can acquire a list lock to prevent the application from accessing the lists' items while they're being modified.

Note

If the library's internal execution thread gets blocked by the list lock it won't be able to process any other messages from the display server until the list lock gets released.