The foreach identifier and closures

前端 未结 7 1367
误落风尘
误落风尘 2020-11-22 10:51

In the two following snippets, is the first one safe or must you do the second one?

By safe I mean is each thread guaranteed to call the method on the Foo from the s

7条回答
  •  无人及你
    2020-11-22 11:06

    Foo f2 = f;
    

    points to the same reference as

    f 
    

    So nothing lost and nothing gained ...

提交回复
热议问题