Exemplo n.º 1
0
        internal SCPCardReader(int port)
            : base("unknown SCP device")
        {
            this.port   = port;
            this.handle = IntPtr.Zero;

            this.pollThread = new PollThread(this);
            this.pollThread.Start();
        }
        private PcscSmartCardSubsystem(Options options, SCardApi scardApi)
        {
            this.scardApi   = scardApi;
            this.pollThread = new PollThread(this, scardApi);
            this.pollThread.Start();

            if (options.SynchronousInitialisation)
            {
                this.pollThread.WaitForInitialisation();
            }
        }
Exemplo n.º 3
0
            public void Dispose()
            {
                // Ensure PollThread polls for SessionPollFlags.
                bool      interruptPollThread = false;
                PollFlags sessionPollFlags    = _client.SessionPollFlags;
                PollFlags pollThreadPollFlags = _client.PollThreadPollFlags;

                if ((sessionPollFlags & ~pollThreadPollFlags) != 0)
                {
                    _client.PollThreadPollFlags = sessionPollFlags | pollThreadPollFlags;
                    interruptPollThread         = true;
                }

                Monitor.Exit(_client.Gate);
                _client = null !;

                if (interruptPollThread)
                {
                    PollThread.InterruptPollThread();
                }
            }