Right okay I think I've fixed it. It displays some errors but continues to work. I can't say it fully works because my hotel isn't at its peak users.
To be honest, I'm sad the few people in this thread who have a fix aren't releasing it. People are so greedy and selfish here, but whatever here's my fix:
note* tested, seems to work.
PHP Code:
using System;
using System.Threading;
public class TimedLock : IDisposable
{
public static TimedLock Lock(object o)
{
return Lock(o, TimeSpan.FromSeconds(10)); // set time in seconds here
}
private static TimedLock Lock(object o, TimeSpan timeout)
{
TimedLock tl = new TimedLock(o);
if (!Monitor.TryEnter(o, timeout))
{
// throw the exception because the lock did not release properly...
throw new LockTimeoutException();
}
return tl;
}
private TimedLock(object o)
{
target = o;
}
private object target;
public void Dispose()
{
// exit the try monitor
Monitor.Exit(target);
}
private class LockTimeoutException : Exception
{
public LockTimeoutException()
: base("Timeout whilst waiting for lock") // lock timed out...
{
}
}
}
I was actually going to fix homepages and groups for UberCMS since I'm quite good in PHP but from what I've seen in this thread and people not helping me out I don't feel inclined to help them.
Some one report back if this works.
Thanks.