private NcaFileSystemService(NcaFileSystemServiceImpl serviceImpl, ulong processId) { ServiceImpl = serviceImpl; ProcessId = processId; AocMountCountSemaphore = new SemaphoreAdaptor(AocSemaphoreCount, AocSemaphoreCount); RomMountCountSemaphore = new SemaphoreAdaptor(RomSemaphoreCount, RomSemaphoreCount); }
public static ReferenceCountedDisposable <NcaFileSystemService> CreateShared( NcaFileSystemServiceImpl serviceImpl, ulong processId) { // Create the service var ncaService = new NcaFileSystemService(serviceImpl, processId); // Wrap the service in a ref-counter and give the service a weak self-reference var sharedService = new ReferenceCountedDisposable <NcaFileSystemService>(ncaService); ncaService.SelfReference = new ReferenceCountedDisposable <NcaFileSystemService> .WeakReference(sharedService); return(sharedService); }