[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Threads - does the @synchronized Directive work?

From: David Wetzel
Subject: Threads - does the @synchronized Directive work?
Date: Wed, 21 Dec 2005 00:34:28 +0100

hi folks,

I just red that

In addition to lock classes, the Objective-C language includes the 
@synchronized directive for locking a 
block of code. The directive takes a single parameter, which is the object you 
want to be used as the 
key for locking the code. The compiler then creates a mutex lock based on that 
object. Threads 
attempting to lock the same object block until the current synchronized block 
finishes executing. The 
following example shows what this directive looks like when used in your code.


Looks very interesting. Does GCC do that too or just newer/Apple versions?

   _  _
 _(_)(_)_  David Wetzel, Turbocat's Development,
(_) __ (_) Buchhorster Strasse 23, D-16567 Muehlenbeck/Berlin, FRG,
  _/  \_   Fax +49 33056 82835 Phone +49 33056 82834

reply via email to

[Prev in Thread] Current Thread [Next in Thread]