synchronized { }

torhu no at spam.invalid
Mon Jun 30 14:35:00 PDT 2008


Steven Schveighoffer wrote:
> "torhu" wrote
>> Steven Schveighoffer wrote:
>>> In any case, Tango avoids needing this statement by making mutexes fully 
>>> accessible objects.  If you need a mutex without having it attached to an 
>>> object, it's easy:
>>>
>>> Mutex m = new Mutex;
>>>
>>> synchronized(m)
>>> {
>>> }
>>
>>
>> Isn't that the same as doing this?
>>
>> ---
>> Object m = new Object;
>>
>> synchronized(m)
>> {
>> }
> 
> It's close, but in Tango, you have methods for the mutex, plus you can use 
> them with conditions.
> 
> Plus, it's not as hackish :)

Sure, but my point was just that your example doesn't do anything that 
my example doesn't.



More information about the Digitalmars-d mailing list