<<>> <> <> <> <<>> <> <> <<>> DIRECTORY IO, MakeDo, MakeDoBasics, MakeDoPorting, Rope, SystemNames USING [UserCedarDir], UserProfile; MakeDoCedarImpl: CEDAR MONITOR IMPORTS IO, SystemNames, UserProfile EXPORTS MakeDo, MakeDoPorting, MakeDoBasics ~ BEGIN OPEN MakeDo; ROPE: TYPE ~ Rope.ROPE; NYI: ERROR; MaxProcessAllocationDefault: INT ~ 2; -- small because of limit on number of open files!! -- <> existsFSWatch: PUBLIC BOOL ¬ FALSE; defaultReporter: PUBLIC ROPE ¬ "files"; logPath: PUBLIC ROPE ¬ SystemNames.UserCedarDir[NIL]; <> verifyAttachments: PUBLIC BOOL ¬ FALSE; StartFSWatchers: PUBLIC PROC = { ERROR NYI; }; <> JobResources: TYPE ~ MakeDoBasics.JobResources; <> processUse: INTEGER ¬ 0; maxProcessUse: INTEGER ¬ 0; processAllocation: INTEGER ¬ 0; <> ForkParms: TYPE ~ REF ForkParmsRep; ForkParmsRep: PUBLIC TYPE ~ RECORD [ pa: INT ]; <> <<>> ShouldFork: PUBLIC PROC RETURNS [fork: BOOL, valid: BOOL ¬ FALSE, resources: JobResources ¬ NIL] ~ { IF processAllocation = 0 THEN { fork ¬ FALSE; valid ¬ TRUE; RETURN; }; IF processUse> <<>> InnerGetForkParms: PUBLIC PROC RETURNS [forkParms: ForkParms] = { <<-- INNER -- already protected by MakeDoBasicImpl.GetForkParms[]>> pa: NAT; pa ¬ processAllocation; RETURN [NEW [ForkParmsRep ¬ [pa: pa]]]; }; InnerSetForkParms: PUBLIC PROC [forkParms: ForkParms] ~ { <<-- INNER -- already protected by MakeDoBasicImpl.GetForkParms[]>> WITH forkParms SELECT FROM fp: REF ForkParmsRep => { processAllocation ¬ fp.pa; } ENDCASE => ERROR; RETURN}; ForkParmsFromStream: PUBLIC PROC [in: IO.STREAM] RETURNS [parms: ForkParms] ~ { pa: NAT ~ in.GetInt[]; RETURN [NEW [ForkParmsRep ¬ [pa: pa]]]; }; ForkParmsFromProfile: PUBLIC PROC RETURNS [ForkParms] ~ { pa: INT ~ UserProfile.Number["MakeDo.AuxilliaryProcessAllocation", MaxProcessAllocationDefault]; RETURN [NEW [ForkParmsRep ¬ [pa: pa]]]; }; END.