summaryrefslogtreecommitdiff
path: root/documentation/advanced.html
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2007-02-08 23:04:20 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2007-02-08 23:04:20 +0000
commit6e9a1630357a21c6ef6357cdde324ae89a565826 (patch)
treeefc85bf8e365b2da7f6dd91e56f78fb5e4574604 /documentation/advanced.html
parent057e542c395a8cc5391ee57a215c2c644a2fbd0b (diff)
Add handler for thread messages (STR #1536)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5683 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'documentation/advanced.html')
-rw-r--r--documentation/advanced.html38
1 files changed, 12 insertions, 26 deletions
diff --git a/documentation/advanced.html b/documentation/advanced.html
index 52c3009b6..51ea1895b 100644
--- a/documentation/advanced.html
+++ b/documentation/advanced.html
@@ -9,24 +9,13 @@
<P>This chapter explains advanced programming and design topics
that will help you to get the most out of FLTK.</P>
-<H2><A NAME="multithreading">10.1 Multithreading</H2>
+<H2><A NAME="multithreading">Multithreading</H2>
-<P>FLTK supports multithreaded application using a locking mechanism
-based on "pthreads". We do not provide a threading interface
-as part of the library. However a simple example how threads can
-be implemented for all supported platforms can be found in
-<tt>test/threads.h</tt> and <tt>test/threads.cxx</tt>.
+<P>FLTK supports multithreaded application using a locking mechanism based on "pthreads". We do not provide a threading interface as part of the library. However a simple example how threads can be implemented for all supported platforms can be found in <tt>test/threads.h</tt> and <tt>test/threads.cxx</tt>.
-<P>To use the locking mechanism, the command line version of FLTK
-must be compiled with <tt>--enable-threads</tt> set during the
-<tt>configure</tt> process. IDE-based versions of FLTK are
-automatically compiled with locking enabled if possible.
+<P>To use the locking mechanism, FLTK must be compiled with <tt>--enable-threads</tt> set during the <tt>configure</tt> process. IDE-based versions of FLTK are automatically compiled with locking enabled if possible.
-<P>In <TT>main()</TT>, before calling <TT>Fl::run()</TT>, call
-<TT>Fl::lock()</TT>. This will startup the runtime multithreading
-support for your program. All callbacks and derived functions
-like <tt>handle()</tt> and <tt>draw()</tt> will now be properly
-locked.
+<P>In <TT>main()</TT>, call <TT>Fl::lock()</TT> before <TT>Fl::run()</TT> to start the runtime multithreading support for your program. All callbacks and derived functions like <tt>handle()</tt> and <tt>draw()</tt> will now be properly locked.
<pre>
main() {
@@ -56,34 +45,31 @@ in the following code:
<P>FLTK supports multiple platforms, some of them which do not
allow any other but the main thread to handle system events and
open or close windows. The safe thing to do is to adhere to the
-following rulesi for threads on all operating systems.
+following rules for threads on all operating systems:
<ul>
-<li>don't <tt>show()</tt> or <tt>hide()</tt>anything that contains
+<li>Don't <tt>show()</tt> or <tt>hide()</tt>anything that contains
widgets derived from <tt>Fl_Window</tt>, including dialogs, file
choosers, subwindows or <tt>Fl_GL_Window</tt>s</li>
-<li>don't call <tt>Fl::wait()</tt>, <tt>Fl::flush()</tt> or any
+<li>Don't call <tt>Fl::wait()</tt>, <tt>Fl::flush()</tt> or any
related methods that will handle system messages</li>
-<li>don't start or cancel timers</li>
+<li>Don't start or cancel timers</li>
-<li>don't change window decorations or titles</li>
+<li>Don't change window decorations or titles</li>
-<li><tt>make_current()</tt> may or may not work well for regular
-windows, but should always work for <tt>Fl_GL_Window</tt>s to
-allow for high speed rendering on graphics cards with multiple
-pipelines</li>
+<li>The <tt>make_current()</tt> method may or may not work well for regular windows, but should always work for <tt>Fl_GL_Window</tt>s to allow for high speed rendering on graphics cards with multiple pipelines</li>
</ul>
<P>See also:
+<a href="Fl.html#Fl.awake">void awake(void *message)</A>,
<a href="Fl.html#Fl.lock">void lock()</A>,
<a href="Fl.html#Fl.unlock">void unlock()</A>,
-<a href="Fl.html#Fl.awake">void awake(void *message)</A>,
+<a href="Fl.html#Fl.set_awake_cb">void set_awake_cb(void (*cb)(void *)</A>,
<a href="Fl.html#Fl.thread_message">void *thread_message()</A>.
-
</BODY>
</HTML>