-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Trying to compile the above-referenced file results in a slew of errors, most of them like this:
~/Desktop/ThreadSampleCode/ThreadSampleCode/UnboundedBlockingQueue.m:17:9: Implicit declaration of function 'pthread_mutex_init' is invalid in C99
~/Desktop/ThreadSampleCode/ThreadSampleCode/UnboundedBlockingQueue.m:17:9: Declaration of 'pthread_mutex_init' must be imported from module 'Darwin.POSIX.pthread' before it is required
To fix it, add the following import statement to UnboundedBlockingQueue.h:
#import <pthread.h>
The new header file should now read, in totality:
#import <Foundation/Foundation.h>
#import <pthread.h>
#import <sys/time.h>
#import "Node.h"
@interface UnboundedBlockingQueue : NSObject{
@private
pthread_mutex_t lock;
pthread_cond_t notEmpty;
Node *first, *last;
}
- (UnboundedBlockingQueue*) init;
- (void) put: (id) data;
- (id) take: (int) timeout;
@end
Metadata
Metadata
Assignees
Labels
No labels