Assembla home | Assembla project page
 

Changeset 153

Show
Ignore:
Timestamp:
05/06/08 18:22:46 (3 months ago)
Author:
ToyinA
Message:

Added [ThreadStatic?] in order to provide Thread-safety.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/QLNet/QLNet/Currencies/ExchangeRateManager.cs

    r99 r153  
    22 Copyright (C) 2008 Andrea Maggiulli 
    33 Copyright (C) 2008 Siarhei Novik (snovik@gmail.com) 
    4    
     4 Copyright (C) 2008 Toyin Akin (toyin_akin@hotmail.com) 
     5  
    56 This file is part of QLNet Project http://www.qlnet.org 
    67 
     
    2223using System.Collections.Generic; 
    2324using System.Text; 
     25using System.Threading; 
    2426 
    2527namespace QLNet 
     
    3133   public class ExchangeRateManager  
    3234   { 
     35      [ThreadStatic] 
    3336      public static readonly ExchangeRateManager Instance = new ExchangeRateManager(); 
    3437      private ExchangeRateManager() { 
  • trunk/QLNet/QLNet/Indexes/Indexmanager.cs

    r62 r153  
    11/* 
    22 Copyright (C) 2008 Siarhei Novik (snovik@gmail.com) 
    3    
     3 Copyright (C) 2008 Toyin Akin (toyin_akin@hotmail.com) 
     4 *  
    45 This file is part of QLNet Project http://www.qlnet.org 
    56 
     
    1920using System; 
    2021using System.Collections.Generic; 
    21 using QLNet
     22using System.Threading
    2223 
    2324namespace QLNet { 
    2425    //! global repository for past index fixings 
    2526    public static class IndexManager { 
     27 
     28        [ThreadStatic] 
    2629        private static Dictionary<string, TimeSeries<double>> data_ = new Dictionary<string, TimeSeries<double>>(); 
    2730                 
  • trunk/QLNet/QLNet/Money.cs

    r151 r153  
    11/* 
    22 Copyright (C) 2008 Andrea Maggiulli 
    3    
     3 Copyright (C) 2008 Toyin Akin (toyin_akin@hotmail.com) 
     4  
    45 This file is part of QLNet Project http://www.qlnet.org 
    56 
     
    2122using System.Collections.Generic; 
    2223using System.Text; 
     24using System.Threading; 
    2325 
    2426namespace QLNet 
     
    5254      #region Attributes 
    5355 
     56      [ThreadStatic] 
    5457      public static ConversionType conversionType; 
     58 
     59      [ThreadStatic] 
    5560      public static Currency baseCurrency; 
     61 
    5662      private double value_; 
    5763      private Currency currency_; 
  • trunk/QLNet/QLNet/Settings.cs

    r97 r153  
    11/* 
    22 Copyright (C) 2008 Siarhei Novik (snovik@gmail.com) 
    3    
     3 Copyright (C) 2008 Toyin Akin (toyin_akin@hotmail.com) 
     4 *  
    45 This file is part of QLNet Project http://www.qlnet.org 
    56 
     
    2021using System.Collections.Generic; 
    2122using System.Text; 
    22 using QLNet
     23using System.Threading
    2324 
    2425namespace QLNet { 
     
    2627    // we can not derive it from IObservable because the class is static 
    2728    public static class Settings { 
     29 
     30        [ThreadStatic] 
    2831        private static Date evaluationDate_ = Date.Today; 
     32 
     33        [ThreadStatic] 
    2934        private static bool enforcesTodaysHistoricFixings_ = false; 
    3035 
     
    4348        // Observable interface 
    4449        private static event Callback notifyObserversEvent; 
     50 
    4551        public static void registerWith(Callback handler) { notifyObserversEvent += handler; } 
    4652        public static void unregisterWith(Callback handler) { notifyObserversEvent -= handler; }