AffineThreadPool now uses standard semaphores in Windows builds; command line parser is satisfied with an IList of arguments instead of requiring a concrete List instance; added NCrunch XML file to svn:ignore list

git-svn-id: file:///srv/devel/repo-conversion/nusu@222 d2e56fa2-650e-0410-a79f-9358c0239efd
This commit is contained in:
Markus Ewald 2012-02-01 10:39:39 +00:00
parent 1a215987ac
commit 54d82e9659
4 changed files with 19 additions and 5 deletions

View file

@ -19,10 +19,10 @@ License along with this library
#endregion
using System;
using System.Threading;
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Threading;
namespace Nuclex.Support {
@ -88,7 +88,11 @@ namespace Nuclex.Support {
// as we may run into situations where multiple operations need to be atomic.
// We keep track of the threads we've created just for good measure; not actually
// needed for any core functionality.
#if XBOX360
workAvailable = new Semaphore();
#else
workAvailable = new System.Threading.Semaphore(0, Processors);
#endif
userWorkItems = new Queue<UserWorkItem>(Processors * 4);
workerThreads = new List<Thread>(Processors);
inUseThreads = 0;
@ -299,7 +303,11 @@ namespace Nuclex.Support {
/// <summary>
/// Used to let the threads in the thread pool wait for new work to appear.
/// </summary>
#if XBOX360
private static Semaphore workAvailable;
#else
private static System.Threading.Semaphore workAvailable;
#endif
/// <summary>List of all worker threads at the disposal of the thread pool.</summary>
private static List<Thread> workerThreads;
/// <summary>Number of threads currently active.</summary>