Ejemplo n.º 1
0
        public ThreadWrapper(
            IThreadPool ownerThreadPool,
            ISyncObjectsFactory syncObjectsFactory,
            Action <IThread> threadAction)
        {
            this.ownerThreadPool = ownerThreadPool;
            Contract.Requires(syncObjectsFactory != null);
            Contract.Requires(threadAction != null);

#pragma warning disable CC0031 // Check for null before calling a delegate
            thread = new Thread(() => threadAction(this));
#pragma warning restore CC0031 // Check for null before calling a delegate
            thread.CurrentCulture   = CultureInfo.InvariantCulture;
            thread.CurrentUICulture = CultureInfo.InvariantCulture;
            threadStopSignal        = syncObjectsFactory.CreateManualResetSignal(false);
        }
Ejemplo n.º 2
0
 public ThreadPool(ISyncObjectsFactory syncObjectsFactory)
 {
     this.syncObjectsFactory = syncObjectsFactory;
 }