Ejemplo n.º 1
0
        List <RPMusicSong> GetSongsUsingSTAThread(Thread t, object strID)
        {
            t.SetApartmentState(ApartmentState.STA);

            // LOCK
            Monitor.Enter(ExclusiveMusicHelper);
            t.Start(strID);
            t.Join(); // wait for thread
            // While we still have exclusivity, grab the shared object and copy it
            List <RPMusicSong> output = (List <RPMusicSong>)Functions.DeepClone(HelperReturnSongs);

            Monitor.Exit(ExclusiveMusicHelper);

            return(output);
        }