[Vm-dev] Where to get Monitor implementation based on primitives?

Denis Kudriashov dionisiydk at gmail.com
Mon Feb 8 09:07:40 UTC 2016


2016-02-06 8:16 GMT+01:00 Ben Coman <btc at openinworld.com>:

> @Dennis, Why not...
>     primitiveEnterCriticalSectionOnBehalfOf: activeProcess
>          <primitive: 186>
>          self primitiveFailed
>
> I had been meaning to ask what this code at the top of the primitive was
> for...
>     argumentCount > 0
>         ifTrue:
>             [criticalSection := self stackValue: 1.  "rcvr"
>              activeProc := self stackTop]
>         ifFalse:
>             [criticalSection := self stackTop.  "rcvr"
>              activeProc := self activeProcess].
>
> but took a wild guess its to support onBehalfOf type calls.
>

Nice. What about tryAcquire (187)? Does it implemented same way?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20160208/97f3fa49/attachment.htm


More information about the Vm-dev mailing list