"shared" status

Ali Çehreli acehreli at yahoo.com
Tue Apr 17 07:00:59 PDT 2012


On 04/17/2012 06:05 AM, Luis wrote:
> Thanks! It's very useful.
>
> Ali Çehreli wrote:
>
>> synchronized (job) {
>> *job.slice ~= appendValue;
>> }
> So shared, at least share data across threads. And using synchronized( )
> I could do lock-based access to shared data.
>

Yes. I've used the same Job object there but any class is a lock. (This 
has been a new concept for me. The "lock part" of the object is called 
the monitor.)

Ali


More information about the Digitalmars-d-learn mailing list