Changeset 8773


Ignore:
Timestamp:
10/10/12 10:54:03 (7 years ago)
Author:
svonolfe
Message:

Fixed possible race condition (#1955)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DynamicVehicleRouting/HeuristicLab.PDPSimulation/3.3/PickupDeliveryOptimization.cs

    r8670 r8773  
    331331    CancellationTokenSource cts;
    332332
     333    private object threadLocker = new object();
    333334    protected bool running;
    334335
     
    340341      cts = new CancellationTokenSource();
    341342      optThread = new Thread(delegate() {
    342         lock (this) {
     343        lock (threadLocker) {
    343344          started = true;
    344345        }
     
    366367    private bool Started() {
    367368      bool result;
    368       lock (this) {
     369      lock (threadLocker) {
    369370        result = started;
    370371        started = false;
Note: See TracChangeset for help on using the changeset viewer.