Package com.pcmsolutions.system.threads

Examples of com.pcmsolutions.system.threads.ZBackgroundRemoterThread


    // assumes that all indexes are valid!
    private void initializeSpecifiedPresetNames(final int[] indexes, final boolean chainToData) {
        // if (true)
        //   return;
        ZWaitThread t = new ZBackgroundRemoterThread() {
            public void run() {
                this.setName("PresetNamePass");
                Integer preset;
                for (int n = 0, o = indexes.length; n < o; n++) {
                    deviceLock.access();
                    try {
                        if (this.alive == false)
                            return;
                        preset = IntPool.get(indexes[n]);
                        assertPresetNamed(rootPresetContext, preset);
                    } catch (NoSuchPresetException e) {
                    } catch (NoSuchContextException e) {
                    } finally {
                        deviceLock.unlock();
                    }
                }
                if (chainToData)
                    initializeSpecifiedPresetData(indexes);
            }
        };
        workerThreads.add(t);
        t.start();
    }
View Full Code Here


            profs = testRom(rom);

        final SampleRomStore.RomProfile[] f_profs = profs;

        if (f_profs.length == 0) {
            new ZBackgroundRemoterThread("sample name initialization") {
                public void run() {
                    SampleRomNameProvisionMediator npm = new SampleRomNameProvisionMediator() {
                        protected String[] names = new String[DeviceContext.SAMPLE_ROM_SIZE];

                        public boolean wantsNames() {
View Full Code Here

    }

    private void initializeSpecifiedSampleData(final int[] indexes, final SampleRomNameProvisionMediator cb) {
        //if (true)
        //  return;
        ZWaitThread t = new ZBackgroundRemoterThread() {
            public void run() {
                try {
                    this.setName("SampleDataPass");
                    Integer sample;
                    RWLock sLock;
                    Object sobj;
                    for (int n = 0, o = indexes.length; n < o; n++) {
                        device.access();
                        try {
                            if (this.alive == false) {
                                return;
                            }
                            sample = IntPool.get(indexes[n]);
                            sLock = ((RWLock) s2sl.get(sample));
                            sLock.write();
                            try {
                                sobj = s2sobj.get(sample);
                                if (sobj != null && sobj instanceof UninitSampleObject) {
                                    if (cb != null && cb.providesNames())
                                        sobj = scf.initializeSampleAtIndex(sample, cb.getName(sample.intValue()), se_handler);
                                    else
                                        sobj = scf.initializeSampleAtIndex(sample, se_handler);
                                    if (sobj == null)
                                        continue;
                                    s2sobj.put(sample, sobj);
                                    se_handler.postSampleEvent(new SampleInitializeEvent(this, sample));
                                }
                                if (cb != null && sobj != null && cb.wantsNames())
                                    cb.setName(sample.intValue(), sobj.toString());
                            } finally {
                                sLock.unlock();
                            }
                        } finally {
                            device.unlock();
                        }
                        // yield();
                    }
                } finally {
                    if (cb != null)
                        cb.done();
                }
            }
        };
        workerThreads.add(t);
        t.start();
    }
View Full Code Here

TOP

Related Classes of com.pcmsolutions.system.threads.ZBackgroundRemoterThread

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.