|
Инициализация статического класса
|
|||
---|---|---|---|
#18+
ЕвгенийВfkthat Например, Lazy<T> имеет специальный параметр в конструкторе, который как раз позволяет то или иное поведение при неуспешной инициализации выбрать. Удивительное рядом. Это какой такой параметр? Функционал Lazy к данному топику вообще притянут за уши. ... |
|||
:
Нравится:
Не нравится:
|
|||
14.05.2019, 14:39 |
|
Инициализация статического класса
|
|||
---|---|---|---|
#18+
ЕвгенийВfkthat Например, Lazy<T> имеет специальный параметр в конструкторе, который как раз позволяет то или иное поведение при неуспешной инициализации выбрать. Удивительное рядом. Это какой такой параметр? LazyThreadSafetyMode - If the mode is LazyThreadSafetyMode.ExecutionAndPublication or LazyThreadSafetyMode.None , there is no second chance to initialize the Lazy<T> instance . If an exception occurs and is unhandled in the initialization function, that exception is cached and rethrown on subsequent accesses of the Lazy<T>.Value property. No value is created if an exception is thrown, so in such cases IsValueCreated returns false. - If the mode is LazyThreadSafetyMode.PublicationOnly , the first thread that succeeds in running the initialization function (or the default constructor) creates the value for the Lazy<T> instance. If the initialization function throws an exception on one thread, other threads can still try to initialize the Lazy<T> instance . Until the value is created, the IsValueCreated property returns false. ... |
|||
:
Нравится:
Не нравится:
|
|||
14.05.2019, 14:53 |
|
Инициализация статического класса
|
|||
---|---|---|---|
#18+
ЕвгенийВЭто какой такой параметр? Сложно самому в референс заглянуть? ... |
|||
:
Нравится:
Не нравится:
|
|||
14.05.2019, 15:54 |
|
|
start [/forum/topic.php?fid=20&msg=39813098&tid=1398948]: |
0ms |
get settings: |
7ms |
get forum list: |
13ms |
check forum access: |
5ms |
check topic access: |
5ms |
track hit: |
134ms |
get topic data: |
12ms |
get forum data: |
3ms |
get page messages: |
55ms |
get tp. blocked users: |
2ms |
others: | 13ms |
total: | 249ms |
0 / 0 |