-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
@maca88 nhibernate/nhibernate-core#2147 (comment) :
Currently, the async generator is generating separate fields for lock statements that contain an async invocation, which may cause troubles as two threads may simultaneously execute the same code, one for async and one in sync version of the method.
I think the rules should be like following:
-
If there are several methods with
[MethodImpl(Synchronized)]in a class the generator shall generate only one locker fields for all these methods. -
(Optional) The locker should pass the current lock object to the async lock. (
MethodImplOptions.Synchronizedis actually equivalent tolock(GetType())/lock(this))
Metadata
Metadata
Assignees
Labels
No labels