DIRECTORY SVStoragePools; SVStoragePoolsImpl: CEDAR MONITOR LOCKS pool USING pool: StoragePool EXPORTS SVStoragePools = BEGIN MakeStorageProc: TYPE = SVStoragePools.MakeStorageProc; InitializePoolProc: TYPE = SVStoragePools.InitializePoolProc; AllocateProc: TYPE = SVStoragePools.AllocateProc; FreeProc: TYPE = SVStoragePools.FreeProc; StoragePoolClass: TYPE = REF StoragePoolClassObj; StoragePoolClassObj: TYPE = SVStoragePools.StoragePoolClassObj; StoragePool: TYPE = REF StoragePoolObj; StoragePoolObj: TYPE = SVStoragePools.StoragePoolObj; CreateClass: PUBLIC PROC [name: ATOM, init: InitializePoolProc, allocate: AllocateProc, free: FreeProc] RETURNS [class: StoragePoolClass] = { class _ NEW[StoragePoolClassObj _ [name, init, allocate, free]]; }; CreatePool: PUBLIC PROC [class: StoragePoolClass, makeStorage: MakeStorageProc] RETURNS [pool: StoragePool] = { pool _ NEW[StoragePoolObj _ [class: class, data: NIL]]; pool.class.init[pool]; }; Initialize: PUBLIC ENTRY PROC [pool: StoragePool] = { pool.class.init[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. ΈSVStoragePoolsImpl.mesa Copyright c 1986 by Xerox Corporation. All rights reserved. Last edited by Bier on June 5, 1987 2:02:43 pm PDT Contents: Routines for maintaining various storage pools in Solidviews and synchronizing their use. Synchronization is the main reason for the existence of this module. It provides a MONITOR lock for each storage pool. Creates a new pool and runs its initialize proc. Re-initializes the pool. ΚΔ˜J˜Icodešœ™Kšœ Οmœ1™Kšœ˜K˜—K˜Kšžœ˜K˜J˜—…—δ`