Leak in XKeysymToString

Po Lu luangruo at yahoo.com
Mon Aug 22 01:20:35 UTC 2022


Alan Coopersmith <alan.coopersmith at oracle.com> writes:

> Okay, but we also document that Xlib is thread safe if XInitThreads() has
> been called, so both the patch suggested here to keep a static pointer to
> a malloc'ed buffer and my suggestion of a global static buffer fail since
> calls in different threads would have a race condition over whose answer
> got returned.   We'd at least need a thread-specific buffer, which it
> doesn't look like we've done in Xlib so far.

In modern C that is as simple as using _Thread_local, I think.


More information about the xorg-devel mailing list