Marcel Taeumel wrote:
Okay, I disagree. :) Or I need to rephrase the situation here. ;)
I have one process in Pharo that locks the mutex, calls some code and then comes across another piece of code that wants to lock the *same* mutex again in the same process, do some stoff, before return to the original call again. Everything happens in one process (= green thread). As far as I understood, this is the common "recursive" property of a mutex, which could/should work. :)
If the Mutex in Pharo does not support recursive locking from within the same process, then it is more like a binary semaphore, right?
Recursive locking appears to be provided by the following line activeProcess == owner ifTrue:[^aBlock value]. in Mutex>>critical: btw, if you step into your example, you'll see the mutex is implemented using semaphores. cheers -ben
Okay, this simple "nesting" works in Pharo:
m := Mutex new. m critical: [ Morph new. m critical: [Morph new]].
But this is not exactly the same setting as in Animations. I need to test it a little bit more. :)
Best, Marcel