summaryrefslogtreecommitdiff
path: root/src/Fl_x.cxx
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2001-12-06 22:16:49 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2001-12-06 22:16:49 +0000
commitba2be02ab24d170bb03662a8a5f5893f0112aeb7 (patch)
tree7474e6b1a3da5d4c8aaf3c73c4b2e43f607c444a /src/Fl_x.cxx
parent7710dc14a88f02bad07111cc2e29414f2513b28d (diff)
FLTK 2.0 threading support under FLTK 1.1. Needs porting to OSX.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1819 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_x.cxx')
-rw-r--r--src/Fl_x.cxx14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx
index 5788181d6..7572d7d02 100644
--- a/src/Fl_x.cxx
+++ b/src/Fl_x.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_x.cxx,v 1.24.2.24.2.7 2001/11/27 17:44:06 easysw Exp $"
+// "$Id: Fl_x.cxx,v 1.24.2.24.2.8 2001/12/06 22:16:49 easysw Exp $"
//
// X specific code for the Fast Light Tool Kit (FLTK).
//
@@ -179,6 +179,11 @@ static void do_queued_events() {
# endif
}
+// these pointers are set by the Fl::lock() function:
+static void nothing() {}
+void (*fl_lock_function)() = nothing;
+void (*fl_unlock_function)() = nothing;
+
// This is never called with time_to_wait < 0.0:
// It should return negative on error, 0 if nothing happens before
// timeout, and >0 if any callbacks were done.
@@ -197,6 +202,8 @@ int fl_wait(double time_to_wait) {
# endif
int n;
+ fl_unlock_function();
+
if (time_to_wait < 2147483.648) {
# if USE_POLL
n = ::poll(pollfds, nfds, int(time_to_wait*1000 + .5));
@@ -213,6 +220,9 @@ int fl_wait(double time_to_wait) {
n = ::select(maxfd+1,&fdt[0],&fdt[1],&fdt[2],0);
# endif
}
+
+ fl_lock_function();
+
if (n > 0) {
for (int i=0; i<nfds; i++) {
# if USE_POLL
@@ -937,5 +947,5 @@ void Fl_Window::make_current() {
#endif
//
-// End of "$Id: Fl_x.cxx,v 1.24.2.24.2.7 2001/11/27 17:44:06 easysw Exp $".
+// End of "$Id: Fl_x.cxx,v 1.24.2.24.2.8 2001/12/06 22:16:49 easysw Exp $".
//