[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.
on:
http://developer.apple.com/documentation/Cocoa/Conceptual/Multithreading/articles/
CocoaLocks.html#//apple_ref/doc/uid/20000737-134077-BBCCEBFE
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
(______) http://www.turbocat.de/
- Threads - does the @synchronized Directive work?,
David Wetzel <=