Subject: Threads, Timers, Hacks and Crashes
From: Christopher Plymire (chrisjp@eudoramail.com)
Date: Sat Nov 18 2000 - 12:21:35 CST
Thomas has informed me that the BeOS thread / timer issue has been
covered on the list, so I won't get the discussion started all over
again.
Basically, all I want to know is that if it would be reasonable, until
a proper fix for the timer bugs are introduced, to add a lock around
the timer fire call under BeOS? This would prevent more than one
thread from drawing a document currently being modified, such as when a
keypress event occurs.
The keypress event occurs in the view thread, so when a refresh is
currently taking place a line deletion causes a hard crash when the
refresh thread redraws the deleted line.
The fix I propose:
static BLocker ThreadLocker;
In function _Timer_Proc
+ if( ThreadLocker.Lock() )
+ {
pTimer->fire();
+ ThreadLocker.Unlock();
+ }
I don't see any reason why this can't be implemented as a temporary
fix, and I also belive that releasing a new version under BeOS without
either the timer bugs fixed or this patch would be a mistake.
Thoughts?
- Christopher
This archive was generated by hypermail 2b25 : Sat Nov 18 2000 - 09:27:18 CST