From 18f2016b1f743068cd3d4bb9740845c2d55af3f3 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Tue, 20 Mar 2007 10:41:14 +0000 Subject: Removed the Fl::set_awake_cb API and documented the Fl::awake(function, data) API. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5749 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_lock.cxx | 10 +++------- src/Fl_win32.cxx | 1 - 2 files changed, 3 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/Fl_lock.cxx b/src/Fl_lock.cxx index 612d351b0..1f014dbfe 100644 --- a/src/Fl_lock.cxx +++ b/src/Fl_lock.cxx @@ -58,9 +58,8 @@ Fl::awake(void*) - Causes Fl::wait() to return (with the lock locked) even if there are no events ready. - Fl::set_awake_cb(void (*cb)(void *)) - Registers a function - to call for Fl::awake() messages that is called for each - message received. + Fl::awake(void (*cb)(void *), void*) - Call a function + in the main thread from within another thread of execution. Fl::thread_message() - returns an argument sent to an Fl::awake() call, or returns NULL if none. WARNING: the @@ -68,8 +67,6 @@ returns the most recent value! */ -void (*Fl::awake_cb)(void *); - Fl_Awake_Handler *Fl::awake_ring_; void **Fl::awake_data_; int Fl::awake_ring_size_; @@ -91,7 +88,7 @@ int Fl::add_awake_handler_(Fl_Awake_Handler func, void *data) awake_data_ = (void**)malloc(awake_ring_size_*sizeof(void*)); } if (awake_ring_head_==awake_ring_tail_-1 || awake_ring_head_+1==awake_ring_tail_) { - // ring is full. Return -1 as ann error indicator. + // ring is full. Return -1 as an error indicator. ret = -1; } else { awake_ring_[awake_ring_head_] = func; @@ -278,7 +275,6 @@ void* Fl::thread_message() { static void thread_awake_cb(int fd, void*) { read(fd, &thread_message_, sizeof(void*)); - if (Fl::awake_cb) (*Fl::awake_cb)(thread_message_); Fl_Awake_Handler func; void *data; while (Fl::get_awake_handler_(func, data)==0) { diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx index 4df22baae..94686a195 100644 --- a/src/Fl_win32.cxx +++ b/src/Fl_win32.cxx @@ -299,7 +299,6 @@ int fl_wait(double time_to_wait) { if (fl_msg.message == fl_wake_msg) { // Used for awaking wait() from another thread thread_message_ = (void*)fl_msg.wParam; - if (Fl::awake_cb) (*Fl::awake_cb)(thread_message_); Fl_Awake_Handler func; void *data; while (Fl::get_awake_handler_(func, data)==0) { -- cgit v1.2.3