Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. Mutex Releasing [modified]

Mutex Releasing [modified]

Scheduled Pinned Locked Moved .NET (Core and Framework)
questionhelpdiscussion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Tristan Rhodes
    wrote on last edited by
    #1

    Hi All, I have located a Mutex system in code outside my control which causes execution to be delayed until after the current process has completed (Sequential). Inside this Mutex system events are raised, which seems to lead to events being raised only after the current process has completed. This doesn't help my unit tests as the events which should supply the results only occur after the test has failed. :( So my question is, is there any way to suspend the thread and free the Mutex (Which i have no direct access too), so that it can do it's work, raise it's event etc. before continuing? I've tried Thread.Spin(), Thread.Sleep() and Application.DoEvents() as ways of suspending execution, but they don't seem to work. Any thoughts? Regards Tris [Edit: The Mutex appears to be owned by a different thread to the executing one.]

    ------------------------------- Carrier Bags - 21st Century Tumbleweed.

    modified on Thursday, May 7, 2009 5:25 AM

    D 1 Reply Last reply
    0
    • T Tristan Rhodes

      Hi All, I have located a Mutex system in code outside my control which causes execution to be delayed until after the current process has completed (Sequential). Inside this Mutex system events are raised, which seems to lead to events being raised only after the current process has completed. This doesn't help my unit tests as the events which should supply the results only occur after the test has failed. :( So my question is, is there any way to suspend the thread and free the Mutex (Which i have no direct access too), so that it can do it's work, raise it's event etc. before continuing? I've tried Thread.Spin(), Thread.Sleep() and Application.DoEvents() as ways of suspending execution, but they don't seem to work. Any thoughts? Regards Tris [Edit: The Mutex appears to be owned by a different thread to the executing one.]

      ------------------------------- Carrier Bags - 21st Century Tumbleweed.

      modified on Thursday, May 7, 2009 5:25 AM

      D Offline
      D Offline
      datenkabel
      wrote on last edited by
      #2

      Sorry, I don't understand your description. But you could use a named Mutex. So you could get access to this Mutex. The Mutex can just be freed by the thread owning it. Is this the thing you mean with no direct access?

      T 1 Reply Last reply
      0
      • D datenkabel

        Sorry, I don't understand your description. But you could use a named Mutex. So you could get access to this Mutex. The Mutex can just be freed by the thread owning it. Is this the thing you mean with no direct access?

        T Offline
        T Offline
        Tristan Rhodes
        wrote on last edited by
        #3

        Sorry, by No direct access i meant no refference to the object. It's internal to a class in a 3rd party lib library. I've succeeded in avoiding the issue with a retry loop and Thread.Sleep().

        ------------------------------- Carrier Bags - 21st Century Tumbleweed.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups