Uploaded image for project: 'Log4net'
  1. Log4net
  2. LOG4NET-665

Incorrect usage `lock (this)` causing contention and deadlocking

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.0.8, 2.1.0
    • None
    • None

    Description

      In several classes the statement `lock (this)` is used to attempt synchronization of resource access. If this experiences a deadlock, since the majority of the functionality occurs on the calling thread instead of being immediately dispatched, it could cause problems in the calling application.

      There are exceedingly rare cases where its safe to lock on `this` or `Me` and none of the usages in this codebase meet those criteria. 

      This should be triggering violations of CA2002. Some of the affected classes include

       

      This is probably best converted into an Epic or  Story with a bug created for each part that requires fixing, but I will leave that to someone more familiar with this project's workflow.

      Attachments

        Activity

          People

            Unassigned Unassigned
            stingyjack Andrew Stanton
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: