On Tue, 2008-12-02 at 20:12 +0100, Frederik wrote:
> Hi,

Hi,
> I have been experimenting with threads & synchronization in Vala with
> the Dining Philosophers Problem [1] (see attachment). If I want to lock
> a mutex I have to use:
> 
>      mutex.lock ();
>      // ...
>      mutex.unlock ();
> 
> If i use
> 
>      lock (mutex) {
>          // ...
>      }

the lock keyword can be any "object", so I think that you could use

        lock(fork)
        {
                //....
        }

and forget about the mutex. Anyway I didn't try it and I don't know if
Vala permits the use of the lock keyword with an array.




> Regards,
> 
> Frederik

Hope this helps. Ciao,
Andrea

_______________________________________________
Vala-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/vala-list

Reply via email to