ADC Home > Reference Library > Technical Notes > Legacy Documents > Carbon >

Legacy Documentclose button

Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.

Current information on this Reference Library topic can be found here:

Problem with WaitNextEvent in MultiFinder 1.0


This Technical Note discusses a bug in WaitNextEvent in MultiFinder 1.0. This bug only occurs when WaitNextEvent is called from the background. This bug will be fixed in the next release of MultiFinder.

[Nov 01 1987]


    FUNCTION WaitNextEvent(mask: INTEGER; VAR event: EventRecord;
                           sleep: LONGINT; mouseRgn: RgnHandle): BOOLEAN;

    pascal Boolean WaitNextEvent(mask,event,sleep,mouseRgn)
        unsigned short mask;
        EventRecord *event;
        unsigned long sleep;
        RgnHandle mouseRgn;

should not call WaitNextEvent from the background with a value of sleep that is greater than 50. This value has been determined empirically for a Macintosh II; larger values can be used on the Macintosh Plus and the Macintosh SE. If an application uses a large value of sleep when running in the background, MultiFinder 1.0 will hang under the following circumstances:

  • The application that is calling WaitNextEvent with a large sleep value has been put in the background.
  • That application becomes the foreground application when another application (including the desk accessory handler) quits.

If you use a value of sleep that is small enough, this problem will not occur. If you use an algorithm to calculate sleep, make sure that the maximum is clipped to 50.

This problem will be fixed in the next release of MultiFinder. You can call SysEnvirons to test for the system version number. This bug will not happen when the System version is greater than $04FF.

Back to top




Back to top


Acrobat gif

Acrobat version of this Note (48K).


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.