picofuse-objc

NXLock.h
Go to the documentation of this file.
1 
5 #pragma once
6 #include "NXLocking.h"
7 #include <picofuse/sys.h>
8 
20 @interface NXLock : NXObject <NXLocking> {
21 @private
22  sys_mutex_t *_mutex;
23 }
24 
29 - (id)init;
30 
34 - (void)lock;
35 
40 - (BOOL)tryLock;
41 
45 - (void)unlock;
46 
47 @end
void unlock()
Unlocks it, which only the thread which locked it can do.
id init()
Initializes a lock.
void lock()
Locks it, waiting until no other thread holds it.
bool BOOL
A Boolean value.
Definition: runtime.h:60
Defines the NXLocking protocol, for objects which can be locked.
The base class for objects in the Foundation framework.
Definition: NXObject.h:28
BOOL tryLock()
Locks it if no thread holds it.
A lock, which one thread at a time can hold.
Definition: NXLock.h:20
struct objc_object * id
A pointer to an instance of a class.
Definition: runtime.h:18
Objects which can be locked by one thread at a time.
Definition: NXLocking.h:13