Monitor.Wait doesn't work with Unity 5

Hello folks,

For over a year now I’ve been using a class I wrote across different platforms, specifically native .Net C# applications and my current Unity project. This class is a simple threaded logger that writes stuff to a text file on disk. This class has always worked fine, until recently.

Since switching to Unity 5, I noticed that the class no longer works for my Unity project. Debugging it shows different behavior in Unity and a .Net application (wherein it still works).
See the following piece of code:

public void Run()
        isRunning = true;
        while (isRunning)
            lock (obj)
                while (queue.Count <= 0)

I’ve put the entire class up here: (The accompanying thread is created and started somewhere else, usually a controller class)

Normally, upon calling this method, the thread should enter the second while loop and halt at Monitor.Wait() until Monitor.Pulse is called via another method. However, I noticed that in my Unity 5 application, calling Monitor.Wait() doesn’t actually cause the thread to wait… It just keeps looping in the same while loop.

So I assume this is a Mono related issue. Has anyone experienced this and managed to find a workaround?

Looks like its fixed in 5.5.