5
.Net framework有Interlocked.Add()
方法只適用於int
和long
。但我需要Interlock.Add()
爲double
類型。我怎樣才能做到這一點?Interlock.Add()for double
.Net framework有Interlocked.Add()
方法只適用於int
和long
。但我需要Interlock.Add()
爲double
類型。我怎樣才能做到這一點?Interlock.Add()for double
這是不可能的,你可以在這個問題上閱讀stackoverflow。它還提供了一篇關於它的文章:
Why is there no overload of Interlocked.Add that accepts Doubles as parameters?
如果問題是重複的,請張貼鏈接作爲評論(或者,一旦你有名譽,投票),而不是在一個答案。 (或者至少用你自己的話來寫出答案:p) – Rawling
沒有。閱讀討論這裏:http://stackoverflow.com/questions/1400465/why-is-there-no-overload-of-interlocked-add-that-accepts-doubles-as-parameters – RAS