Skip to content

Async locking #130

@hazzik

Description

@hazzik

@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:

  1. If there are several methods with [MethodImpl(Synchronized)] in a class the generator shall generate only one locker fields for all these methods.

  2. (Optional) The locker should pass the current lock object to the async lock. (MethodImplOptions.Synchronized is actually equivalent to lock(GetType())/lock(this))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions