ObjFW  Diff

Differences From Artifact [b2db698d51]:

To Artifact [705ced3614]:

  • File src/OFKernelEventObserver.h — part of check-in [85917ea0dd] at 2016-03-20 14:19:43 on branch 0.8 — Use the locked queue for kqueue and epoll as well

    _readObjects must only be changed from the thread running the observer
    and not from a thread adding or removing objects to observe. This is
    already handled by the locked queue used by poll and select, so the best
    way to solve this is to use the locked queue for kqueue and epoll as
    well. (user: js, size: 7000) [annotate] [blame] [check-ins using]


21
22
23
24
25
26
27

28
29
30
31
32
33
34
OF_ASSUME_NONNULL_BEGIN

@class OFMutableArray OF_GENERIC(ObjectType);
@class OFDate;
#ifdef OF_HAVE_THREADS
@class OFMutex;
#endif


/*!
 * @protocol OFKernelEventObserverDelegate
 *	     OFKernelEventObserver.h ObjFW/OFKernelEventObserver.h
 *
 * @brief A protocol that needs to be implemented by delegates for
 *	  OFKernelEventObserver.







>







21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
OF_ASSUME_NONNULL_BEGIN

@class OFMutableArray OF_GENERIC(ObjectType);
@class OFDate;
#ifdef OF_HAVE_THREADS
@class OFMutex;
#endif
@class OFDataArray;

/*!
 * @protocol OFKernelEventObserverDelegate
 *	     OFKernelEventObserver.h ObjFW/OFKernelEventObserver.h
 *
 * @brief A protocol that needs to be implemented by delegates for
 *	  OFKernelEventObserver.
118
119
120
121
122
123
124


125
126
127
128
129
130
131
#else
	of_socket_t _cancelFD[2];
	struct sockaddr_in _cancelAddr;
#endif
#ifdef OF_HAVE_THREADS
	OFMutex *_mutex;
#endif


}

#ifdef OF_HAVE_PROPERTIES
@property OF_NULLABLE_PROPERTY (assign)
    id <OFKernelEventObserverDelegate> delegate;
#endif








>
>







119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#else
	of_socket_t _cancelFD[2];
	struct sockaddr_in _cancelAddr;
#endif
#ifdef OF_HAVE_THREADS
	OFMutex *_mutex;
#endif
	OFDataArray *_queueActions;
	OFMutableArray *_queueObjects;
}

#ifdef OF_HAVE_PROPERTIES
@property OF_NULLABLE_PROPERTY (assign)
    id <OFKernelEventObserverDelegate> delegate;
#endif