Skip to content

Locale locking fixes

Keith Packard requested to merge keithp/libx11:locale-locking into master

This is a slightly re-worked set of fixes that was originally authored by Jacek Caban jacek@codeweavers.com in 2017.

  1. Add locking around character set conversion contexts.
  2. Remove some static variables in Xlcmbtowc and _Xlcwctomb
  3. Admit that we can never unload locale context data

The last is the only one I expect to evoke a bit of concern -- we're committing to never releasing memory used by X locale data. The reason for this is pretty simple -- _XlcCurrentLC returns a pointer to locale data which has no bound on lifetime as there's no matching free function. Because of this, I removed all of the reference counting and turned _XCloseLC into a no-op. This latter bit replaces the patch that Jacek wrote which added locking to this function.

Merge request reports