Sha256: 29ef568f7aeafba30169658d9cdcbc03c42cced2d9f360ca825d5b76be045631

Contents?: true

Size: 813 Bytes

Versions: 3

Compression:

Stored size: 813 Bytes

Contents

#import "YapDatabaseConnectionState.h"

#if ! __has_feature(objc_arc)
#warning This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC).
#endif


@implementation YapDatabaseConnectionState

- (id)initWithConnection:(YapDatabaseConnection *)inConnection
{
	if ((self = [super init]))
	{
		connection = inConnection;
	}
	return self;
}

- (void)dealloc
{
#if !OS_OBJECT_USE_OBJC
	if (writeSemaphore)
		dispatch_release(writeSemaphore);
#endif
}

- (void)prepareWriteLock;
{
	if (writeSemaphore == NULL) {
		writeSemaphore = dispatch_semaphore_create(0);
	}
}

- (void)waitForWriteLock
{
	if (writeSemaphore) {
		dispatch_semaphore_wait(writeSemaphore, DISPATCH_TIME_FOREVER);
	}
}

- (void)signalWriteLock
{
	if (writeSemaphore) {
		dispatch_semaphore_signal(writeSemaphore);
	}
}

@end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
motion-yapper-0.0.3 vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseConnectionState.m
motion-yapper-0.0.2 vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseConnectionState.m
motion-yapper-0.0.1 vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseConnectionState.m