Fixed refcount handling (waiting clients must not increase the
[wine/multimedia.git] / documentation / winedev-graphical.sgml
blob72c3a04ebb3c43c16ac8a145ea7fb14230c58bff
1 <chapter>
2 <title>Graphical modules</title>
3 <sect1>
4 <title>GDI Module</title>
6 <sect2>
7 <title>X Windows System interface</title>
9 <para>
10 The X libraries used to implement X clients (such as Wine)
11 do not work properly if multiple threads access the same
12 display concurrently. It is possible to compile the X
13 libraries to perform their own synchronization (initiated
14 by calling <function>XInitThreads()</function>). However,
15 Wine does not use this approach. Instead Wine performs its
16 own synchronization using the
17 <function>wine_tsx11_lock()</function> / <function>wine_tsx11_unlock()</function>
18 functions. This locking protects library access
19 with a critical section, and also arranges things so that
20 X libraries compiled without <option>-D_REENTRANT</option>
21 (eg. with global <varname>errno</varname> variable) will
22 work with Wine.
23 </para>
24 <para>
25 In the past, all calls to X used to go through a wrapper called
26 <function>TSX...()</function> (for "Thread Safe X ...").
27 While it is still being used in the code, it's inefficient
28 as the lock is potentially aquired and released unnecessarily.
29 New code should explicitly aquire the lock.
30 </para>
31 </sect2>
32 </sect1>
33 </chapter>
35 <!-- Keep this comment at the end of the file
36 Local variables:
37 mode: sgml
38 sgml-parent-document:("wine-devel.sgml" "set" "book" "part" "chapter" "")
39 End:
40 -->