DIRECTORY GGStoragePools; GGStoragePoolsImpl: CEDAR MONITOR LOCKS pool USING pool: StoragePool EXPORTS GGStoragePools = BEGIN MakeStorageProc: TYPE = GGStoragePools.MakeStorageProc; AllocateProc: TYPE = GGStoragePools.AllocateProc; FreeProc: TYPE = GGStoragePools.FreeProc; StoragePoolClass: TYPE = REF StoragePoolClassObj; StoragePoolClassObj: TYPE = GGStoragePools.StoragePoolClassObj; StoragePool: TYPE = REF StoragePoolObj; StoragePoolObj: TYPE = GGStoragePools.StoragePoolObj; CreateClass: PUBLIC PROC [name: ATOM, allocate: AllocateProc, free: FreeProc] RETURNS [class: StoragePoolClass] = { class ¬ NEW[StoragePoolClassObj ¬ [name, allocate, free]]; }; CreatePool: PUBLIC PROC [class: StoragePoolClass, makeStorage: MakeStorageProc] RETURNS [pool: StoragePool] = { pool ¬ NEW[StoragePoolObj ¬ [class: class, data: NIL]]; makeStorage[pool]; }; Allocate: PUBLIC ENTRY PROC [pool: StoragePool] RETURNS [item: REF ANY] = { item ¬ pool.class.allocate[pool]; }; Free: PUBLIC ENTRY PROC [pool: StoragePool, item: REF ANY] = { pool.class.free[pool, item]; }; END. ˆ GGStoragePoolsImpl.mesa Contents: Routines for maintaining various storage pools and synchronizing their use. Synchronization is the main reason for the existence of this module. It provides a MONITOR lock for each storage pool. Copyright Σ 1986, 1992 by Xerox Corporation. All rights reserved. Bier, June 5, 1987 2:02:43 pm PDT Creates a new pool and runs its initialize proc. ΚΒ•NewlineDelimiter –(cedarcode) style™codešœ™KšΟnœ€Οkœ™ΟKšœ Οeœ6™BKšœž™!K™—šž ˜ Kšœ˜—K˜šœžœž œžœ˜DKšžœ˜—Kšž˜K˜Kšœžœ"˜7Kšœžœ˜1Kšœ žœ˜)K˜Kšœžœžœ˜1Kšœžœ&˜?K˜Kšœ žœžœ˜'Kšœžœžœž˜5K˜š œž œžœ*žœ˜sKšœžœ/˜:K˜K˜—š œž œ9žœ˜oK™0Kšœžœ%žœ˜7Kšœ˜˜K™——š œžœžœžœžœ˜KK˜!K˜—šœžœžœžœ˜>Kšœ˜K˜—K˜Kšžœ˜K˜K˜K˜—…—2|