Allegro.cc - Online Community

Allegro.cc Forums » Allegro Development » OS X 10.4 (Tiger) and Grabber v4.2.0 Beta 3

This thread is locked; no one can reply to it. rss feed Print
 1   2 
OS X 10.4 (Tiger) and Grabber v4.2.0 Beta 3
Evert
Member #794
November 2000
avatar

Quote:

I've made two patches (attached) The first does pretty much what Matthew's does, i.e. it separates the dirty lines bit from the event mutex

Are you sure that that is always safe?
How about Elias' suggetsion of changing the order in which mutexes are locked? Does that solve the problem too?

Quote:

IMO the first one is better

Yes, I agree. Any estimate on when you have a final patch ready?

Elias
Member #358
May 2000

I also agree, if the first one fixes the deadlock, it should be used. Maybe note in todo.txt to investigate if you are allowed to call two OSX functions from two threads without locking or not. (If not, then maybe need to have a closer look some time, since there may be a race condition then.)

--
"Either help out or stop whining" - Evert

Peter Hull
Member #1,136
March 2001

It could be more serious than I thought. Look at this code (from qzwindow.m)

1/* osx_qz_acquire_win:
2 * Bitmap locking for Quartz windowed mode.
3 */
4static void osx_qz_acquire_win(BITMAP *bmp)
5{
6 /* to prevent the drawing threads and the rendering proc
7 from concurrently accessing the dirty lines array */
8 if (lock_nesting == 0)
9 pthread_mutex_lock(&osx_window_mutex);
10 lock_nesting++;
11 bmp->id |= BMP_ID_LOCKED;
12}
13 
14 
15 
16/* osx_qz_release_win:
17 * Bitmap unlocking for Quartz windowed mode.
18 */
19static void osx_qz_release_win(BITMAP *bmp)
20{
21 if (lock_nesting > 0) {
22 lock_nesting--;
23 if (!lock_nesting)
24 pthread_mutex_unlock(&osx_window_mutex);
25 }
26 bmp->id &= ~BMP_ID_LOCKED;
27}

These functions are not thread-safe; it's possible for 2 threads to modify lock_nesting at the same time.
I hope that I've just messed something up, but when I run the test program*, and go to Graphics->Blitting Functions->Blit, the program locks when I move the mouse, every time. Both the main thread and the mouse-updating thread are trying to acquire the screen at the same time.

Any comments - does this happen for you?

Pete

  • This is with my patch#1 applied.

[edit] No, it happens with the current Allegro, too. Am I going mad? Help :o

Kitty Cat
Member #2,815
October 2002
avatar

Quote:

These functions are not thread-safe.

What was done in X was check if lock == 0 || pthread_self() != some_saved_pthread_id_var. The id var is set after the lock, so if a second thread tries to lock while the first has it, it'll attempt to acquire a lock itself regardless, and thusly wait until the first releases.

But there's another issue there. If a single thread locks a bitmap more than once, the first call to release bitmap will prematurely clear the BMP_ID_LOCKED bitflag.

--
"Do not meddle in the affairs of cats, for they are subtle and will pee on your computer." -- Bruce Graham

Matthew Leverton
Supreme Loser
January 1999
avatar

Quote:

when I run the test program*, and go to Graphics->Blitting Functions->Blit, the program locks when I move the mouse, every time.

Same here, with or without the patch applied.

Elias
Member #358
May 2000

In the X11 port, now the functions _unix_lock_mutex and _unix_unlock_mutex seem to be used instead - they do just what Chris said, but nicely wrapped into an opaque mutex type. Peter will be able to tell you more about it, he wrote it after all it seems :)

--
"Either help out or stop whining" - Evert

Peter Wang
Member #23
April 2000

Eric wrote them. Those functions implement a 'recursive' mutex on top of non-recursive mutexes, in the way described. 'Recursive' in this case means a thread which already has the lock on a mutex can lock the mutex more times without deadlocking.

Peter Hull
Member #1,136
March 2001

Thanks for all the input. I've looked some more and I'm pretty sure we have two problems here. The first is Ultio's, which I believe will be fixed moving the osx_update_dirty_lines from inside the event mutex, as discussed. I can prepare an official patch for that and send it to [AD].
The second is the one is the one I saw in 'test', confirmed by Matthew. Here, some interaction between the mouse (function mouse_move) and the allegro 'user' thread (thread #2) cause the screen to remain acquired forever, and the screen update thread (#1) blocks. However, thread #2 is still running, just that nothing can be seen, and no events can be received.
I fixed this by changing the locking code, as Kitty noted, so that it only changes bmp->id when the bitmap is first locked or finally unlocked. This solved the problem, but the screen now doesn't update when the mouse is 'dragged.' I believe the fix for this, is to adopt the same thread-aware mutex that Peter described for the Unix port. I'll try and produce a quick working patch for this, probably by copy/pasting the code from the unix subdirectory. Ultimately, the code should be shared between Unix and OSX - what is the best way to do this (will need makefile changes) My focus is on getting something to work for the release candidate. It's amazing that no-one has spotted this before, AFAIK it's always been like that in the code...

Sorry there's no better news at the moment.

Pete

Elias
Member #358
May 2000

_unix_lock_mutex already is shared by the OSX port, you can access it as system_driver->lock_mutex. (Look in include/allegro/system.h for the vtable, and in src/macosx/system.m for the OSX implementation.. it simply uses the mentioned _unix_lock_mutex.)

--
"Either help out or stop whining" - Evert

Peter Hull
Member #1,136
March 2001

Elias, thanks for that info. There are some difficulties in using system_driver->XXX_mutex functions (which I found out after I'd changed them all)
1. The vsync handler uses a condition variable which would need access to the 'real' pthreads mutex
2. It makes the first use of the mutexes [i]before[/i] system_driver is set.

So I changed them all to _unix_XXX_mutex, and used a separate bare pthreads mutex for the vsync.
To summarise the changes:
1. Moved update_dirty_lines from the event mutex
2. Changed the acquire/release code so that the bitmap->id field is updated correctly (only on first acquire/last release)
3. Changed to thread-safe mutexes implemented bu uthreads.c (actually this doesn't help anything but it's safer for the future)

This is quite a big patch (attached.) IMO such a big change makes me nervous for RC1, I would suggest sticking with the old threads and just implementing changes 1 & 2 above.

This fixes the bugs as follows
1. Occasional deadlock on start-up (grabber) - FIXED
2. Screen locks up when the mouse is moved at the same time as the screen is being updated (test program) - FIXED
3. Screen does not update while mouse is dragged (test) - NOT FIXED

I have not got to the bottom of number 3 yet. It only happens if the cursor is displayed (e.g. dragging during the blit test), it doesn't happen during the mouse test. As far as I can see, the app still runs, just the screen doesn't update, but I think I need to make a test program for this.

Unfortunately I'm away this weekend, please could someone cast an eye over the code and see if there's anything obvious.

Cheers
Pete

[code]
? src/macosx/.DS_Store
Index: src/macosx/main.m
===================================================================
RCS file: /cvsroot/alleg/allegro/src/macosx/main.m,v
retrieving revision 1.24
diff -u -r1.24 main.m
--- src/macosx/main.m 12 Jun 2005 08:13:38 -0000 1.24
+++ src/macosx/main.m 16 Jun 2005 22:11:23 -0000
@@ -74,7 +74,8 @@
char path[1024], *p;
int i;

- pthread_mutex_init(&osx_event_mutex, NULL);
+ /* create mutex */
+ osx_event_mutex=_unix_create_mutex();

pool = [[NSAutoreleasePool alloc] init];

@@ -113,24 +114,24 @@
[NSThread detachNewThreadSelector: @selector(app_main:)
toTarget: [AllegroAppDelegate class]
withObject: nil];
-
+
while (1) {
- pthread_mutex_lock(&osx_event_mutex);
- osx_event_handler();
if (osx_gfx_mode == OSX_GFX_WINDOW)
osx_update_dirty_lines();
- else if (osx_gfx_mode == OSX_GFX_FULL) {
+ _unix_lock_mutex(osx_event_mutex);
+ if (osx_gfx_mode == OSX_GFX_FULL) {
if ((osx_palette) && (osx_palette_dirty)) {
CGDisplaySetPalette(kCGDirectMainDisplay, osx_palette);
osx_palette_dirty = FALSE;
}
}
- pthread_mutex_unlock(&osx_event_mutex);
+ osx_event_handler();
+ _unix_unlock_mutex(osx_event_mutex);
usleep(1000000 / refresh_rate);
}

[pool release];
- pthread_mutex_destroy(&osx_event_mutex);
+ _unix_destroy_mutex(osx_event_mutex);
}


Index: src/macosx/qzfull.m
===================================================================
RCS file: /cvsroot/alleg/allegro/src/macosx/qzfull.m,v
retrieving revision 1.21
diff -u -r1.21 qzfull.m
--- src/macosx/qzfull.m 14 May 2005 12:14:00 -0000 1.21
+++ src/macosx/qzfull.m 16 Jun 2005 22:11:25 -0000
@@ -252,9 +252,9 @@
static BITMAP *osx_qz_full_init(int w, int h, int v_w, int v_h, int color_depth)
{
BITMAP *bmp;
- pthread_mutex_lock(&osx_event_mutex);
+ _unix_lock_mutex(osx_event_mutex);
bmp = private_osx_qz_full_init(w, h, v_w, v_h, color_depth);
- pthread_mutex_unlock(&osx_event_mutex);
+ _unix_unlock_mutex(osx_event_mutex);
if (!bmp)
osx_qz_full_exit(bmp);
return bmp;
@@ -267,7 +267,7 @@
*/
static void osx_qz_full_exit(BITMAP *bmp)
{
- pthread_mutex_lock(&osx_event_mutex);
+ _unix_lock_mutex(osx_event_mutex);

if ((bmp) && (bmp->extra)) {
if (BMP_EXTRA(bmp)->port)
@@ -294,7 +294,7 @@

osx_gfx_mode = OSX_GFX_NONE;

- pthread_mutex_unlock(&osx_event_mutex);
+ _unix_unlock_mutex(osx_event_mutex);
}


@@ -321,7 +321,7 @@
if (!CGDisplayCanSetPalette(kCGDirectMainDisplay))
return;

- pthread_mutex_lock(&osx_event_mutex);
+ _unix_lock_mutex(osx_event_mutex);

for (i = from; i <= to; i++) {
color.red = ((float)p[i].r / 63.0);
@@ -331,7 +331,7 @@
}
osx_palette_dirty = TRUE;

- pthread_mutex_unlock(&osx_event_mutex);
+ _unix_unlock_mutex(osx_event_mutex);
}


Index: src/macosx/qzmouse.m
===================================================================
RCS file: /cvsroot/alleg/allegro/src/macosx/qzmouse.m,v
retrieving revision 1.16
diff -u -r1.16 qzmouse.m
--- src/macosx/qzmouse.m 1 May 2005 13:51:02 -0000 1.16
+++ src/macosx/qzmouse.m 16 Jun 2005 22:11:26 -0000
@@ -163,9 +163,9 @@
osx_hid_free(device, num_devices);
}

- pthread_mutex_lock(&osx_event_mutex);
+ _unix_lock_mutex(osx_event_mutex);
osx_emulate_mouse_buttons = (max_buttons == 1) ? TRUE : FALSE;
- pthread_mutex_unlock(&osx_event_mutex);
+ _unix_unlock_mutex(osx_event_mutex);

return max_buttons;
}
@@ -203,7 +203,7 @@
NSRect frame;
int screen_height;

- pthread_mutex_lock(&osx_event_mutex);
+ _unix_lock_mutex(osx_event_mutex);

_mouse_x = point.x = x;
_mouse_y = point.y = y;
@@ -220,7 +220,7 @@
mymickey_x = mymickey_y = 0;
osx_mouse_warped = TRUE;

- pthread_mutex_unlock(&osx_event_mutex);
+ _unix_unlock_mutex(osx_event_mutex);
}


@@ -245,13 +245,13 @@
*/
static void osx_mouse_get_mickeys(int *mickeyx, int *mickeyy)
{
- pthread_mutex_lock(&osx_event_mutex);
+ _unix_lock_mutex(osx_event_mutex);

*mickeyx = mymickey_x;
*mickeyy = mymickey_y;
mymickey_x = mymickey_y = 0;

- pthread_mutex_unlock(&osx_event_mutex);
+ _unix_unlock_mutex(osx_event_mutex);
}


@@ -344,9 +344,9 @@
[cursor_image addRepresentation: cursor_rep];
cursor = [[NSCursor alloc] initWithImage: cursor_image
hotSpot: NSMakePoint(x, y)];
- pthread_mutex_lock(&osx_event_mutex);
+ _unix_lock_mutex(osx_event_mutex);
osx_cursor = requested_cursor = cursor;
- pthread_mutex_unlock(&osx_event_mutex);
+ _unix_unlock_mutex(osx_event_mutex);
if (temp)
destroy_bitmap(temp);

@@ -368,9 +368,9 @@
if (!requested_cursor)
return -1;

- pthread_mutex_lock(&osx_event_mutex);
+ _unix_lock_mutex(osx_event_mutex);
osx_cursor = requested_cursor;
- pthread_mutex_unlock(&osx_event_mutex);
+ _unix_unlock_mutex(osx_event_mutex);

return 0;
}
@@ -382,9 +382,9 @@
*/
void osx_mouse_hide(void)
{
- pthread_mutex_lock(&osx_event_mutex);
+ _unix_lock_mutex(osx_event_mutex);
osx_cursor = osx_blank_cursor;
- pthread_mutex_unlock(&osx_event_mutex);
+ _unix_unlock_mutex(osx_event_mutex);
}


@@ -424,8 +424,8 @@
default:
return 0;
}
- pthread_mutex_lock(&osx_event_mutex);
+ _unix_lock_mutex(osx_event_mutex);
osx_cursor = requested_cursor;
- pthread_mutex_unlock(&osx_event_mutex);
+ _unix_unlock_mutex(osx_event_mutex);
return cursor;
}
Index: src/macosx/qzwindow.m
===================================================================
RCS file: /cvsroot/alleg/allegro/src/macosx/qzwindow.m,v
retrieving revision 1.18
diff -u -r1.18 qzwindow.m
--- src/macosx/qzwindow.m 1 May 2005 13:41:30 -0000 1.18
+++ src/macosx/qzwindow.m 16 Jun 2005 22:11:29 -0000
@@ -29,8 +29,9 @@
static void osx_qz_window_exit(BITMAP *);
static void osx_qz_window_vsync(void);
static void osx_qz_window_set_palette(AL_CONST struct RGB *, int, int, int);
+static void osx_signal_vsync(void);

-
+static pthread_mutex_t vsync_mutex;
static pthread_cond_t vsync_cond;
static int lock_nesting = 0;
static AllegroWindowDelegate *window_delegate = NULL;
@@ -49,7 +50,7 @@
static GFX_VTABLE _special_vtable; /* special vtable for offscreen bitmap */


-pthread_mutex_t osx_window_mutex;
+void* osx_window_mutex;


GFX_DRIVER gfx_quartz_window =
@@ -106,7 +107,7 @@
unsigned int *addr;
int pitch, y, x;

- pthread_mutex_lock(&osx_window_mutex);
+ _unix_lock_mutex(osx_window_mutex);
while (![qd_view lockFocusIfCanDraw]);
while (!QDDone([qd_view qdPort]));
LockPortBits([qd_view qdPort]);
@@ -129,7 +130,7 @@
}
UnlockPortBits([qd_view qdPort]);
[qd_view unlockFocus];
- pthread_mutex_unlock(&osx_window_mutex);
+ _unix_unlock_mutex(osx_window_mutex);
}


@@ -183,9 +184,9 @@
*/
- (void)windowDidDeminiaturize: (NSNotification *)aNotification
{
- pthread_mutex_lock(&osx_window_mutex);
+ _unix_lock_mutex(osx_window_mutex);
memset(dirty_lines, 1, gfx_quartz_window.h);
- pthread_mutex_unlock(&osx_window_mutex);
+ _unix_unlock_mutex(osx_window_mutex);
}

@end
@@ -217,10 +218,11 @@
{
/* to prevent the drawing threads and the rendering proc
from concurrently accessing the dirty lines array */
- if (lock_nesting == 0)
- pthread_mutex_lock(&osx_window_mutex);
- lock_nesting++;
+ if (lock_nesting == 0) {
+ _unix_lock_mutex(osx_window_mutex);
bmp->id |= BMP_ID_LOCKED;
+ }
+ lock_nesting++;
}


@@ -232,10 +234,11 @@
{
if (lock_nesting > 0) {
lock_nesting--;
- if (!lock_nesting)
- pthread_mutex_unlock(&osx_window_mutex);
+ if (!lock_nesting) {
+ bmp->id &= ~BMP_ID_LOCKED;
+ _unix_unlock_mutex(osx_window_mutex);
+ }
}
- bmp->id &= ~BMP_ID_LOCKED;
}


@@ -291,12 +294,12 @@
return;

/* Skip everything if there are no dirty lines */
- pthread_mutex_lock(&osx_window_mutex);
+ _unix_lock_mutex(osx_window_mutex);
for (rect.top = 0; (rect.top < gfx_quartz_window.h) && (!dirty_lines[rect.top]); rect.top++)
;
if (rect.top >= gfx_quartz_window.h) {
- pthread_mutex_unlock(&osx_window_mutex);
- pthread_cond_broadcast(&vsync_cond);
+ _unix_unlock_mutex(osx_window_mutex);
+ osx_signal_vsync();
return;
}

@@ -352,9 +355,9 @@

UnlockPortBits([qd_view qdPort]);
[qd_view unlockFocus];
- pthread_mutex_unlock(&osx_window_mutex);
+ _unix_unlock_mutex(osx_window_mutex);

- pthread_cond_broadcast(&vsync_cond);
+ osx_signal_vsync();
}


@@ -371,7 +374,7 @@
CFNumberGetValue(CFDictionaryGetValue(mode, kCGDisplayBitsPerPixel), kCFNumberSInt32Type, &desktop_depth);
desktop_depth = (desktop_depth == 16) ? 15 : desktop_depth;

- pthread_mutex_lock(&osx_window_mutex);
+ _unix_lock_mutex(osx_window_mutex);
if (colorconv_blitter)
_release_colorconv_blitter(colorconv_blitter);
colorconv_blitter = _get_colorconv_blitter(requested_color_depth, desktop_depth);
@@ -380,7 +383,7 @@
_set_colorconv_palette(_current_palette, 0, 255);
/* Mark all the window as dirty */
memset(dirty_lines, 1, gfx_quartz_window.h);
- pthread_mutex_unlock(&osx_window_mutex);
+ _unix_unlock_mutex(osx_window_mutex);

return (colorconv_blitter ? 0 : -1);
}
@@ -399,7 +402,8 @@
char tmp1[128], tmp2[128];

pthread_cond_init(&vsync_cond, NULL);
- pthread_mutex_init(&osx_window_mutex, NULL);
+ pthread_mutex_init(&vsync_mutex, NULL);
+ osx_window_mutex=_unix_create_mutex();
lock_nesting = 0;

if (1
@@ -527,9 +531,9 @@
static BITMAP *osx_qz_window_init(int w, int h, int v_w, int v_h, int color_depth)
{
BITMAP *bmp;
- pthread_mutex_lock(&osx_event_mutex);
+ _unix_lock_mutex(osx_event_mutex);
bmp = private_osx_qz_window_init(w, h, v_w, v_h, color_depth);
- pthread_mutex_unlock(&osx_event_mutex);
+ _unix_unlock_mutex(osx_event_mutex);
if (!bmp)
osx_qz_window_exit(bmp);
return bmp;
@@ -542,7 +546,7 @@
*/
static void osx_qz_window_exit(BITMAP *bmp)
{
- pthread_mutex_lock(&osx_event_mutex);
+ _unix_lock_mutex(osx_event_mutex);

if (update_region) {
DisposeRgn(update_region);
@@ -573,14 +577,15 @@
colorconv_blitter = NULL;
}

- pthread_mutex_destroy(&osx_window_mutex);
+ _unix_destroy_mutex(osx_window_mutex);
pthread_cond_destroy(&vsync_cond);
+ pthread_mutex_destroy(&vsync_mutex);

osx_mouse_tracking_rect = -1;

osx_gfx_mode = OSX_GFX_NONE;

- pthread_mutex_unlock(&osx_event_mutex);
+ _unix_unlock_mutex(osx_event_mutex);
}


@@ -590,13 +595,9 @@
*/
static void osx_qz_window_vsync(void)
{
- if (lock_nesting > 0)
- pthread_cond_wait(&vsync_cond, &osx_window_mutex);
- else {
- pthread_mutex_lock(&osx_window_mutex);
- pthread_cond_wait(&vsync_cond, &osx_window_mutex);
- pthread_mutex_unlock(&osx_window_mutex);
- }
+ pthread_mutex_lock(&vsync_mutex);
+ pthread_cond_wait(&vsync_cond, &vsync_mutex);
+ pthread_mutex_unlock(&vsync_mutex);
}


@@ -609,11 +610,17 @@
if (vsync)
osx_qz_window_vsync();

- pthread_mutex_lock(&osx_window_mutex);
+ _unix_lock_mutex(osx_window_mutex);
_set_colorconv_palette(p, from, to);

/* invalidate the whole screen */
memset(dirty_lines, 1, gfx_quartz_window.h);

- pthread_mutex_unlock(&osx_window_mutex);
+ _unix_unlock_mutex(osx_window_mutex);
+}
+
+void osx_signal_vsync(void) {
+ pthread_mutex_lock(&vsync_mutex);
+ pthread_cond_broadcast(&vsync_cond);
+ pthread_mutex_unlock(&vsync_mutex);
}
Index: src/macosx/system.m
===================================================================
RCS file: /cvsroot/alleg/allegro/src/macosx/system.m,v
retrieving revision 1.27
diff -u -r1.27 system.m
--- src/macosx/system.m 29 Nov 2004 21:22:07 -0000 1.27
+++ src/macosx/system.m 16 Jun 2005 22:11:31 -0000
@@ -42,7 +42,7 @@
int __crt0_argc;
char **__crt0_argv;
NSBundle *osx_bundle = NULL;
-pthread_mutex_t osx_event_mutex;
+void* osx_event_mutex;
NSCursor *osx_cursor = NULL;
NSCursor *osx_blank_cursor = NULL;
AllegroWindow *osx_window = NULL;
@@ -117,13 +117,13 @@
*/
static RETSIGTYPE osx_signal_handler(int num)
{
- pthread_mutex_unlock(&osx_event_mutex);
- pthread_mutex_unlock(&osx_window_mutex);
+ _unix_unlock_mutex(osx_event_mutex);
+ _unix_unlock_mutex(osx_window_mutex);

allegro_exit();

- pthread_mutex_destroy(&osx_event_mutex);
- pthread_mutex_destroy(&osx_window_mutex);
+ _unix_destroy_mutex(osx_event_mutex);
+ _unix_destroy_mutex(osx_window_mutex);

fprintf(stderr, "Shutting down Allegro due to signal #%d\n", num);
raise(num);
@@ -462,15 +462,15 @@
ns_title = [NSString stringWithUTF8String: osx_window_title];
ns_msg = [NSString stringWithUTF8String: tmp];

- pthread_mutex_lock(&osx_event_mutex);
+ _unix_lock_mutex(osx_event_mutex);
skip_events_processing = TRUE;
- pthread_mutex_unlock(&osx_event_mutex);
+ _unix_unlock_mutex(osx_event_mutex);

NSRunAlertPanel(ns_title, ns_msg, nil, nil, nil);

- pthread_mutex_lock(&osx_event_mutex);
+ _unix_lock_mutex(osx_event_mutex);
skip_events_processing = FALSE;
- pthread_mutex_unlock(&osx_event_mutex);
+ _unix_unlock_mutex(osx_event_mutex);
}

[/code]

Evert
Member #794
November 2000
avatar

Quote:

IMO such a big change makes me nervous for RC1, I would suggest sticking with the old threads and just implementing changes 1 & 2 above.

Hmm... well, if it doesn't matter, then maybe.
On the other hand, this really does need to be fixed, and it's better we do it now than in RC2 or 4.2.1. Put in a different way, we cannot put out a release without fixing issues like this, which means that we cannot output a release candidate without the fixes either.

Patch looks ok to me, but I'm not much of an expert on multi-threading, let alone on MacOS X.

I'll not have time to do the release this weekend anyway, so it's ok if it takes until sometime next week to make the definitive fix. I'd prefer not to put it off too much longer though and get 4.2 RC1 out next weekend.

Elias
Member #358
May 2000

Looks good to me as well.

Hm, and didn't know about using mutexes before the system driver is set. The reason they are in the vtable is because the platform independent timer code calls them as well I think, so I see no problem calling them directly.

About what changes to make - you're the OSX developer, so I guess it's up to you to decide what to do for RC1 :)

--
"Either help out or stop whining" - Evert

Peter Hull
Member #1,136
March 2001

Your idiot said:

3. Screen does not update while mouse is dragged (test) - NOT FIXED

I have not got to the bottom of number 3 yet. It only happens if the cursor is displayed (e.g. dragging during the blit test), it doesn't happen during the mouse test. As far as I can see, the app still runs, just the screen doesn't update, but I think I need to make a test program for this.

Unfortunately I'm away this weekend, please could someone cast an eye over the code and see if there's anything obvious.

There was something obvious; this snippet from test.c, approx line 124

if (mouse_b) {
      do {
         poll_mouse();
      } while (mouse_b);
      return TRUE;
   }

i.e. what I had thought was a 'locking-up' bug is actually the desired behaviour.
::)

I now feel more confident about submitting my patches to [AD], especially now the next release might be b4 instead of rc1 - I'll check once again and send them on.

Peter

 1   2 


Go to: