I have some IronPython code that is creating a Mutex using the following constructor:
public Mutex( bool initiallyOwned, string name, out bool createdNew )
Since the last parameter is an out parameter you do not pass it to the method and instead it becomes an extra return value like this:
mutex, sucess = Mutex(True, 'some_mutex')
When this code runs it throws a TypeError saying that the Mutex object is not iterable. Since it is only returning one value this leads me to believe that IronPython is not choosing the correct overload. The Ironpython documentation says that you can control the exact overload that gets called by using the Overloads method on method objects.
The following bit of code attempts that, however, I get a ValueError stating that the index was out of range:
new_mutex = Mutex.__new__.Overloads[type(True), String, type(True)]
mutex, sucess = new_mutex(Mutex, True, 'some_mutex')
If I try using the Overloads attribute to force using a different overload it executes correctly. Anyone know where I'm going wrong?
outparameters. That would be better off as a factory method.System.Threading.Mutex's constructor here--he doesn't own the signature design for that constructor at all.