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 c 1986 by Xerox Corporation. All rights reserved. Bier, June 5, 1987 2:02:43 pm PDT Creates a new pool and runs its initialize proc. Κ‘˜J˜Icodešœ™šΟnœ€Οkœ™ΟKšœ Οmœ1™Kšœ˜K˜—K˜Kšžœ˜K˜J˜J˜—…—4U