[comp.sys.mac.programmer] VBL Tasks and Inits

mikeoro@hubcap.UUCP (Michael K O'Rourke) (03/03/89)

Does anyone have example init source that installs a VBL Task??? 

The discussion of it in IM seems simple, but whatever i do, it seems to either
crash the machine on bootup or else do nothing at all.  I'll probably post my
present code for ya'll to rip apart in a couple days if i an't figure anything
else out.

Thanks,
Michael O'Rourke


=========================================================================
| Disclaimer:  I don't need one. Who'd sue a poor college student?      |
|-----------------------------------------------------------------------|
| "All right you f@#king monkeys! Ask me anything!" -- Preacher Lane    |
|   (No offensive intended by the language or to religious persons)     |
=========================================================================

tim@hoptoad.uucp (Tim Maroney) (03/04/89)

In article <4646@hubcap.UUCP> mikeoro@hubcap.UUCP (Michael K O'Rourke) writes:
>Does anyone have example init source that installs a VBL Task??? 
>
>The discussion of it in IM seems simple, but whatever i do, it seems to either
>crash the machine on bootup or else do nothing at all.  I'll probably post my
>present code for ya'll to rip apart in a couple days if i an't figure anything
>else out.

The usual problem in this case is that you are just installing a pointer
to a routine in your INIT resource.  The INIT resource goes away when the
system is finished running the INIT, so the VBL task pointer goes off into
weirdspace and dies.  The way to do this is to put the task in a separate
locked code resource in the system heap, and call DetachResource on that
code resource from your INIT so it will stick around after the INIT file
is closed.
-- 
Tim Maroney, Consultant, Eclectic Software, sun!hoptoad!tim
"There are no Famous People on the net.  Only some of us with bigger mouths
 than others."  -- Dan'l Danehy-Oakes, The Roach