diff options
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSConditionLock.java')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSConditionLock.java | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSConditionLock.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSConditionLock.java new file mode 100644 index 0000000000..681ccfe111 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSConditionLock.java @@ -0,0 +1,55 @@ +package org.eclipse.swt.internal.cocoa; + +public class NSConditionLock extends NSObject { + +public NSConditionLock() { + super(); +} + +public NSConditionLock(int id) { + super(id); +} + +public int condition() { + return OS.objc_msgSend(this.id, OS.sel_condition); +} + +public id initWithCondition(int condition) { + int result = OS.objc_msgSend(this.id, OS.sel_initWithCondition_1, condition); + return result != 0 ? new id(result) : null; +} + +public boolean lockBeforeDate(NSDate limit) { + return OS.objc_msgSend(this.id, OS.sel_lockBeforeDate_1, limit != null ? limit.id : 0) != 0; +} + +public void lockWhenCondition_(int condition) { + OS.objc_msgSend(this.id, OS.sel_lockWhenCondition_1, condition); +} + +public boolean lockWhenCondition_beforeDate_(int condition, NSDate limit) { + return OS.objc_msgSend(this.id, OS.sel_lockWhenCondition_1beforeDate_1, condition, limit != null ? limit.id : 0) != 0; +} + +public NSString name() { + int result = OS.objc_msgSend(this.id, OS.sel_name); + return result != 0 ? new NSString(result) : null; +} + +public void setName(NSString n) { + OS.objc_msgSend(this.id, OS.sel_setName_1, n != null ? n.id : 0); +} + +public boolean tryLock() { + return OS.objc_msgSend(this.id, OS.sel_tryLock) != 0; +} + +public boolean tryLockWhenCondition(int condition) { + return OS.objc_msgSend(this.id, OS.sel_tryLockWhenCondition_1, condition) != 0; +} + +public void unlockWithCondition(int condition) { + OS.objc_msgSend(this.id, OS.sel_unlockWithCondition_1, condition); +} + +} |