Bracket calls to timer callbacks with fl_lock_function()/fl_unlock_function() as occurs under WIN32 and X11.

This was also missing in the FLTK 1.1 carbon version.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10019 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Manolo Gouy 2013-11-13 15:49:48 +00:00
parent 88cea3c82d
commit 6b67e50cbe

View File

@ -463,9 +463,7 @@ static void processFLTKEvent(void) {
* break the current event loop
*/
static void breakMacEventLoop()
{
fl_lock_function();
{
NSPoint pt={0,0};
NSEvent *event = [NSEvent otherEventWithType:NSApplicationDefined location:pt
modifierFlags:0
@ -473,7 +471,6 @@ static void breakMacEventLoop()
windowNumber:0 context:NULL
subtype:FLTKTimerEvent data1:0 data2:0];
[NSApp postEvent:event atStart:NO];
fl_unlock_function();
}
//
@ -521,6 +518,7 @@ static void delete_timer(MacTimeout& t)
static void do_timer(CFRunLoopTimerRef timer, void* data)
{
fl_lock_function();
current_timer = (MacTimeout*)data;
current_timer->pending = 0;
(current_timer->callback)(current_timer->data);
@ -529,6 +527,7 @@ static void do_timer(CFRunLoopTimerRef timer, void* data)
current_timer = NULL;
breakMacEventLoop();
fl_unlock_function();
}
void Fl::add_timeout(double time, Fl_Timeout_Handler cb, void* data)